本文整理匯總了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;
}