Java 类javax.persistence.GenerationType 实例源码
项目:hibernate-ogm-redis
文件:Dog.java
@Id @GeneratedValue(strategy = GenerationType.TABLE, generator = "dog")
@TableGenerator(
name = "dog",
table = "sequences",
pkColumnName = "key",
pkColumnValue = "dog",
valueColumnName = "seed"
)
public Long getId() { return id; }
项目:lams
文件:EnumConversionHelper.java
public static String generationTypeToGeneratorStrategyName(GenerationType generatorEnum, boolean useNewGeneratorMappings) {
switch ( generatorEnum ) {
case IDENTITY:
return "identity";
case AUTO:
return useNewGeneratorMappings
? "enhanced-sequence"
: "native";
case TABLE:
return useNewGeneratorMappings
? "enhanced-table"
: MultipleHiLoPerTableGenerator.class.getName();
case SEQUENCE:
return useNewGeneratorMappings
? "enhanced-sequence"
: "seqhilo";
}
throw new AssertionFailure( "Unknown GeneratorType: " + generatorEnum );
}
项目:Incubator
文件:CategoryModel.java
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = COLUMN_NAME__ID)
public long getId() {
if (idProperty == null) {
return _id;
} else {
return idProperty.get();
}
}
项目:oma-riista-web
文件:SrvaEvent.java
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "srva_event_id", nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
return id;
}
项目:oma-riista-web
文件:ObservationContextSensitiveFields.java
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(nullable = false)
@Access(value = AccessType.PROPERTY)
@Override
public Long getId() {
return id;
}
项目:stroom-stats
文件:BaseEntitySmall.java
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = ID, columnDefinition = NORMAL_KEY_DEF)
@XmlTransient
@Override
public long getId() {
return id;
}
项目:Equella
文件:LanguageString.java
@Override
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public long getId()
{
return id;
}
项目:Equella
文件:LanguageBundle.java
@Override
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public long getId()
{
return id;
}
项目:lams
文件:JPAOverriddenAnnotationReader.java
private GeneratedValue buildGeneratedValue(Element element) {
Element subElement = element != null ? element.element( "generated-value" ) : null;
if ( subElement != null ) {
AnnotationDescriptor ad = new AnnotationDescriptor( GeneratedValue.class );
String strategy = subElement.attributeValue( "strategy" );
if ( "TABLE".equalsIgnoreCase( strategy ) ) {
ad.setValue( "strategy", GenerationType.TABLE );
}
else if ( "SEQUENCE".equalsIgnoreCase( strategy ) ) {
ad.setValue( "strategy", GenerationType.SEQUENCE );
}
else if ( "IDENTITY".equalsIgnoreCase( strategy ) ) {
ad.setValue( "strategy", GenerationType.IDENTITY );
}
else if ( "AUTO".equalsIgnoreCase( strategy ) ) {
ad.setValue( "strategy", GenerationType.AUTO );
}
else if ( StringHelper.isNotEmpty( strategy ) ) {
throw new AnnotationException( "Unknown GenerationType: " + strategy + ". " + SCHEMA_VALIDATION );
}
copyStringAttribute( ad, subElement, "generator", false );
return AnnotationFactory.create( ad );
}
else {
return null;
}
}
项目:lams
文件:BasicAttribute.java
private IdGenerator checkGeneratedValueAnnotation() {
IdGenerator generator = null;
AnnotationInstance generatedValueAnnotation = JandexHelper.getSingleAnnotation(
annotations(),
JPADotNames.GENERATED_VALUE
);
if ( generatedValueAnnotation != null ) {
String name = JandexHelper.getValue( generatedValueAnnotation, "generator", String.class );
if ( StringHelper.isNotEmpty( name ) ) {
generator = getContext().getMetadataImplementor().getIdGenerator( name );
if ( generator == null ) {
throw new MappingException( String.format( "Unable to find named generator %s", name ), null );
}
}
else {
GenerationType genType = JandexHelper.getEnumValue(
generatedValueAnnotation,
"strategy",
GenerationType.class
);
String strategy = EnumConversionHelper.generationTypeToGeneratorStrategyName(
genType,
getContext().getMetadataImplementor().getOptions().useNewIdentifierGenerators()
);
generator = new IdGenerator( null, strategy, null );
}
}
return generator;
}
项目:tianti
文件:OracleLongEntity.java
@Id
@SequenceGenerator(name = "ID_SEQ")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ID_SEQ")
@Column(name = "ID", nullable = false)
public Long getId() {
return id;
}
项目:tap17-muggl-javaee
文件:VendorPart.java
@TableGenerator(
name="vendorPartGen",
table="PERSISTENCE_ORDER_SEQUENCE_GENERATOR",
pkColumnName="GEN_KEY",
valueColumnName="GEN_VALUE",
pkColumnValue="VENDOR_PART_ID",
allocationSize=10)
@Id
@GeneratedValue(strategy=GenerationType.TABLE, generator="vendorPartGen")
public Long getVendorPartNumber() {
return vendorPartNumber;
}
项目:hibernate-ogm-ignite
文件:Dog.java
@Id @GeneratedValue(strategy = GenerationType.TABLE, generator = "dog")
@TableGenerator(
name = "dog",
table = "sequences",
pkColumnName = "key",
pkColumnValue = "dog",
valueColumnName = "seed"
)
public Long getId() { return id; }
项目:DWSurvey
文件:IdLongEntity.java
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
//@GeneratedValue(strategy = GenerationType.AUTO, generator = "uuid-string")
//@GeneratedValue(generator = "system-uuid")
//@GenericGenerator(name = "system-uuid", strategy = "uuid")
//@Column(length = 32)
public Long getId() {
return id;
}
项目:sbc-qsystem
文件:QUser.java
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.AUTO)
@Override
public Long getId() {
return id;
}
项目:sbc-qsystem
文件:QReport.java
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.AUTO)
@Override
public Long getId() {
return id;
}
项目:helium
文件:Camp.java
@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator="gen_camp")
@TableGenerator(name="gen_camp", table="hel_idgen", pkColumnName="taula", valueColumnName="valor")
@Column(name="id")
public Long getId() {
return id;
}
项目:helium
文件:Registre.java
@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator="gen_registre")
@TableGenerator(name="gen_registre", table="hel_idgen", pkColumnName="taula", valueColumnName="valor")
@Column(name="id")
public Long getId() {
return id;
}
项目:helium
文件:Tasca.java
@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator="gen_tasca")
@TableGenerator(name="gen_tasca", table="hel_idgen", pkColumnName="taula", valueColumnName="valor")
@Column(name="id")
public Long getId() {
return id;
}
项目:helium
文件:Termini.java
@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator="gen_termini")
@TableGenerator(name="gen_termini", table="hel_idgen", pkColumnName="taula", valueColumnName="valor")
@Column(name="id")
public Long getId() {
return id;
}
项目:report
文件:ReportSql.java
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
/*@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="mseq")
@SequenceGenerator(name="mseq",sequenceName="SEQ_RP_REPORT_SQL",allocationSize=1)*/
@Column(name="sql_id")
public Long getSqlId() {
return this.sqlId;
}
项目:Incubator
文件:MapMarker.java
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id")
public long getId() {
if (this.idProperty == null) {
return _id;
} else {
return idProperty.get();
}
}
项目:helium
文件:AreaMembre.java
@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator="gen_area_membre")
@TableGenerator(name="gen_area_membre", table="hel_idgen", pkColumnName="taula", valueColumnName="valor")
@Column(name="id")
public Long getId() {
return id;
}
项目:helium
文件:DocumentStore.java
@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator="gen_document_store")
@TableGenerator(name="gen_document_store", table="hel_idgen", pkColumnName="taula", valueColumnName="valor")
@Column(name="id")
public Long getId() {
return id;
}
项目:igsn30
文件:LogDate.java
@Id
@Column(name = "log_date_id", unique = true, nullable = false)
@SequenceGenerator(name="log_date_id_seq",schema="version30",sequenceName="log_date_id_seq", allocationSize=1)
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="log_date_id_seq")
public int getLogDateId() {
return this.logDateId;
}
项目:helium
文件:Entorn.java
@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator="gen_entorn")
@TableGenerator(name="gen_entorn", table="hel_idgen", pkColumnName="taula", valueColumnName="valor")
@Column(name="id")
public Long getId() {
return id;
}
项目:helium
文件:Festiu.java
@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator="gen_festiu")
@TableGenerator(name="gen_festiu", table="hel_idgen", pkColumnName="taula", valueColumnName="valor")
@Column(name="id")
public Long getId() {
return id;
}
项目:helium
文件:SequenciaAny.java
@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator="gen_expedient_tipus_seqany")
@TableGenerator(name="gen_expedient_tipus_seqany", table="hel_idgen", pkColumnName="taula", valueColumnName="valor")
@Column(name="id")
public Long getId() {
return id;
}
项目:helium
文件:ExpedientLog.java
@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator="gen_expedient_log")
@TableGenerator(name="gen_expedient_log", table="hel_idgen", pkColumnName="taula", valueColumnName="valor")
@Column(name="id")
public Long getId() {
return id;
}
项目:Incubator
文件:ProjectModel.java
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = COLUMN_NAME__ID)
public long getId() {
if (this.idProperty == null) {
return _id;
} else {
return idProperty.get();
}
}
项目:helium
文件:Estat.java
@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator="gen_estat")
@TableGenerator(name="gen_estat", table="hel_idgen", pkColumnName="taula", valueColumnName="valor")
@Column(name="id")
public Long getId() {
return id;
}
项目:helium
文件:AreaTipus.java
@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator="gen_area_tipus")
@TableGenerator(name="gen_area_tipus", table="hel_idgen", pkColumnName="taula", valueColumnName="valor")
@Column(name="id")
public Long getId() {
return id;
}
项目:igsn30
文件:Contributors.java
@Id
@Column(name = "contributor_id", unique = true, nullable = false)
@SequenceGenerator(name="contributor_id_seq",schema="version30",sequenceName="contributor_id_seq", allocationSize=1)
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="contributor_id_seq")
public int getContributorId() {
return this.contributorId;
}
项目:Incubator
文件:SectionModel.java
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = COLUMN_NAME__ID)
public long getId() {
if (idProperty == null) {
return _id;
} else {
return idProperty.get();
}
}
项目:helium
文件:MapeigSistra.java
@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator="gen_map_sistra")
@TableGenerator(name="gen_map_sistra", table="hel_idgen", pkColumnName="taula", valueColumnName="valor")
@Column(name="id")
public Long getId() {
return id;
}
项目:oma-riista-web
文件:OccupationNomination.java
@Override
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Access(value = AccessType.PROPERTY)
@Column(name = "occupation_nomination_id", nullable = false)
public Long getId() {
return this.id;
}
项目:helium
文件:AreaJbpmId.java
@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator="gen_area_jbpmid")
@TableGenerator(name="gen_area_jbpmid", table="hel_idgen", pkColumnName="taula", valueColumnName="valor")
@Column(name="id")
public Long getId() {
return id;
}
项目:helium
文件:ExpedientTipus.java
@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator="gen_expedient_tipus")
@TableGenerator(name="gen_expedient_tipus", table="hel_idgen", pkColumnName="taula", valueColumnName="valor")
@Column(name="id")
public Long getId() {
return id;
}
项目:helium
文件:Alerta.java
@Id
@GeneratedValue(strategy = GenerationType.TABLE, generator="gen_area")
@TableGenerator(name="gen_area", table="hel_idgen", pkColumnName="taula", valueColumnName="valor")
@Column(name="id")
public Long getId() {
return id;
}
项目:mycore
文件:MCRUser.java
/**
* @return the internalID
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column
int getInternalID() {
return internalID;
}