@Table(tableName="USER_COUNTRY") public class UserCountry { @Id @Generator(generatorType=GeneratorType.AUTOGENERATED_FALLBACK_SEQUENCE, name="SEQ_USER_COUNTRY") private Long id; private String name; public String getName() { return name; } public void setName(final String name) { this.name = name; } public Long getId() { return id; } public void setId(final Long id) { this.id = id; } }
private void generateTableName(TableMap<T> tableMap) { String tableName = FieldDefaultNaming.getJavanameToDBnameDefaultMapping(clazz.getSimpleName()); final Table annotation = clazz.getAnnotation(Table.class); if ( annotation != null) { tableName = annotation.name(); } tableMap.setTableName( tableName ); }
public static TableInfo getTableInfo(final Class<?> clazz) { String tableName = FieldDefaultNaming.getJavanameToDBnameDefaultMapping(clazz.getSimpleName()); String schemaName = ""; //$NON-NLS-1$ final Table annotation = clazz.getAnnotation(Table.class); if ( annotation != null) { tableName = ((annotation.tableName()==null) || annotation.tableName().isEmpty()) ? tableName : annotation.tableName(); schemaName = annotation.schemaName(); } return new TableInfo(tableName, schemaName); }
/** * * @author Francesco Cina * * 08/giu/2011 */ @Table( schemaName = "SCHEMA_NAME") public class AnnotationBean2 { @Id private String index; public long columnNotAnnotated; @Id protected Object columnNotAnnotated2; public String getIndex() { return this.index; } public void setIndex(final String index) { this.index = index; } }
/** * * @author Francesco Cina * * 08/giu/2011 */ @Table(tableName = "ANNOTATION_TABLE_NAME") public class AnnotationBean1 { @Id private String index; public long columnNotAnnotated; @Column(name = "ANNOTATION_COLUMN_NAME") Object columnAnnotated; public String getIndex() { return this.index; } public void setIndex(final String index) { this.index = index; } }
/** * * @author Francesco Cina * * 08/giu/2011 */ @Table(name = "ANNOTATION_TABLE_NAME") public class AnnotationBean1 { @Id private String index; public long columnNotAnnotated; @Column(name = "ANNOTATION_COLUMN_NAME") Object columnAnnotated; public String getIndex() { return index; } public void setIndex(String index) { this.index = index; } }
/** * * @author Francesco Cina' * * 26/ago/2011 */ @Table(tableName="AUTO_ID") public class AutoIdInteger { @Id //NOTE: do not add the ifValueIn for this object!! That could produce false test results!! @Generator(generatorType = GeneratorType.AUTOGENERATED, name="") private Integer id; private String value; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } }
/** * * @author Francesco Cina' * * 26/ago/2011 */ @Table(tableName="AUTO_ID") public class AutoIdInteger { @Id @Generator(generatorType = GeneratorType.AUTOGENERATED_FALLBACK_SEQUENCE, name="seq_auto_id") private Integer id; private String value; public Integer getId() { return id; } public void setId(final Integer id) { this.id = id; } public String getValue() { return value; } public void setValue(final String value) { this.value = value; } }
@Table(name="BLOBCLOB") public class Blobclob_String {
/** * * @author Francesco Cina' * * 26/ago/2011 */ @Table(name="AUTO_ID") public class AutoIdInteger { @Id //NOTE: do not add the ifValueIn for this object!! That could produce false test results!! @Generator(generatorType = GeneratorType.AUTOGENERATED, name="") private Integer id; private String value; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } }
@Table(name="DATA_VERSION_INT") public class DataVersionWithoutGenerator {
@Table(tableName="DATA_VERSION_INT") public class DataVersionWithoutGenerator {
@Table(tableName="BLOBCLOB") public class Blobclob_String {
@Table(tableName="DATA_VERSION_INT") public class DataVersionWithoutGenerator {
@Table(tableName="USER_ADDRESS") public class UserAddress { @FK(references=User.class) private Long userId; @FK @Column(name="COUNTRY_ID") private UserCountry country; public Long getUserId() { return userId; } public void setUserId(final Long userId) { this.userId = userId; } public UserCountry getCountry() { return country; } public void setCountry(final UserCountry country) { this.country = country; } }
@Table(tableName="PEOPLE") public class People_ConditionalGenerator {
/** * * @author Francesco Cina * * 08/giu/2011 */ @Table(tableName = "ANNOTATION_TABLE_NAME" , schemaName = "SCHEMA_NAME") public class AnnotationBean3 { @Id private String index; public long columnNotAnnotated; @Id @Column(name = "ANNOTATION_COLUMN_NAME") Object columnAnnotated; public String getIndex() { return this.index; } public void setIndex(final String index) { this.index = index; } }
@Table(tableName="PEOPLE") public class People_ConditionalGenerator {
@Table(tableName = "PEOPLE", schemaName = "ZOO") public class Zoo_People {
@Table(tableName = "PEOPLE", schemaName = "ZOO") public class Zoo_People {