本文整理汇总了Java中org.hibernate.annotations.GenericGenerator类的典型用法代码示例。如果您正苦于以下问题:Java GenericGenerator类的具体用法?Java GenericGenerator怎么用?Java GenericGenerator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GenericGenerator类属于org.hibernate.annotations包,在下文中一共展示了GenericGenerator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPid
import org.hibernate.annotations.GenericGenerator; //导入依赖的package包/类
@Id
@Column(name="PID",length=15)
@Type(type="int")
@GenericGenerator(name="gen",strategy="increment")
@GeneratedValue(generator="gen")
public int getPid() {
return pid;
}
示例2: getId
import org.hibernate.annotations.GenericGenerator; //导入依赖的package包/类
/** full constructor */
// Property accessors
@GenericGenerator( name = "generator" , strategy = "identity" )
@Id
@GeneratedValue( generator = "generator" )
@Column( name = "id" , unique = true , nullable = false )
public Integer getId() {
return this.id;
}
示例3: getId
import org.hibernate.annotations.GenericGenerator; //导入依赖的package包/类
@Id
@Column(length = 32)
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
public String getId() {
return id;
}
示例4: getId
import org.hibernate.annotations.GenericGenerator; //导入依赖的package包/类
/**
* 默认使用36位uuid作为主键
*
* @return id
*/
@Id
@Column(length = 36, nullable = true)
@GeneratedValue(generator = "uuid")
@GenericGenerator(name = "uuid", strategy = "uuid2")
public String getId() {
return id;
}
示例5: getId
import org.hibernate.annotations.GenericGenerator; //导入依赖的package包/类
@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "user"))
@Id
@GeneratedValue(generator = "generator")
@Column(name = "id", unique = true, nullable = false)
public int getId() {
return this.id;
}
示例6: bindGenericGenerators
import org.hibernate.annotations.GenericGenerator; //导入依赖的package包/类
private static void bindGenericGenerators(XAnnotatedElement annotatedElement, Mappings mappings) {
GenericGenerator defAnn = annotatedElement.getAnnotation( GenericGenerator.class );
GenericGenerators defsAnn = annotatedElement.getAnnotation( GenericGenerators.class );
if ( defAnn != null ) {
bindGenericGenerator( defAnn, mappings );
}
if ( defsAnn != null ) {
for ( GenericGenerator def : defsAnn.value() ) {
bindGenericGenerator( def, mappings );
}
}
}
示例7: getId
import org.hibernate.annotations.GenericGenerator; //导入依赖的package包/类
/**
* @return the id
*/
@Id
@Column(length = 32)
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
public String getId() {
return id;
}
示例8: getId
import org.hibernate.annotations.GenericGenerator; //导入依赖的package包/类
@Id
@Column(length = 32, nullable = true)
@GenericGenerator(name = "sys_uuid", strategy = "uuid")
@GeneratedValue(generator = "sys_uuid")
public String getId() {
return id;
}
示例9: getId
import org.hibernate.annotations.GenericGenerator; //导入依赖的package包/类
@Id
@GenericGenerator(name="generator",strategy="assigned")
@GeneratedValue(generator="generator")
@Column(length=32)
public String getId() {
return id;
}
示例10: getName
import org.hibernate.annotations.GenericGenerator; //导入依赖的package包/类
@Id
@GenericGenerator(name="generator",strategy="assigned")
@GeneratedValue(generator="generator")
@Column(length=32)
public String getName() {
return name;
}
示例11: getId
import org.hibernate.annotations.GenericGenerator; //导入依赖的package包/类
@Id
@GeneratedValue(generator = "uuid")
@GenericGenerator(name = "uuid", strategy = "org.hibernate.id.UUIDGenerator")
@Column(name = "id", unique = true, updatable = false, nullable = false)
@Override
public UUID getId() {
return id;
}
示例12: getId
import org.hibernate.annotations.GenericGenerator; //导入依赖的package包/类
@Id
// @GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
@Column(length = 55)
public String getId() {
return id;
}
示例13: getId
import org.hibernate.annotations.GenericGenerator; //导入依赖的package包/类
@GenericGenerator ( name = "generator" , strategy = "identity" )
@Id
@GeneratedValue ( generator = "generator" )
@Column ( name = "id" , unique = true , nullable = false )
public Integer getId() {
return this.id;
}
示例14: getId
import org.hibernate.annotations.GenericGenerator; //导入依赖的package包/类
@Jsonable
@Column(name = ID)
@Id
@GeneratedValue(generator = UUID)
@GenericGenerator(name = UUID, strategy = UUID)
@Override
public String getId() {
return id;
}
示例15: getId
import org.hibernate.annotations.GenericGenerator; //导入依赖的package包/类
@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "customerAccount"))
@Id
@GeneratedValue(generator = "generator")
@Column(name = "id", unique = true, nullable = false)
public Integer getId() {
return this.id;
}