String.valueOf( tableGeneratorAnnotation.allocationSize() ) );
String.valueOf( tableGeneratorAnnotation.allocationSize() - 1 ) );
annotation.setValue( "pkColumnValue", tableAnn.pkColumnValue() ); annotation.setValue( "initialValue", tableAnn.initialValue() ); annotation.setValue( "allocationSize", tableAnn.allocationSize() ); annotation.setValue( "uniqueConstraints", tableAnn.uniqueConstraints() ); return AnnotationFactory.create( annotation );
updateStmt.setInt(2, random.nextInt(10) + 1); } else { updateStmt.setInt(2, _tg.allocationSize());
public TableGeneratorDiscriptor(TableGenerator tableGenerator, String defaultSchemaName, String defaultPkColumnValue) { this.table = tableGenerator.table().isEmpty() ? default_table_name : tableGenerator.table(); this.schema = tableGenerator.schema().isEmpty() ? defaultSchemaName : tableGenerator.schema(); this.pkColumnName = tableGenerator.pkColumnName().isEmpty() ? default_pkColumn_name : tableGenerator .pkColumnName(); this.valueColumnName = tableGenerator.valueColumnName().isEmpty() ? default_valueColumn_name : tableGenerator .valueColumnName(); this.pkColumnValue = tableGenerator.pkColumnValue().isEmpty() ? defaultPkColumnValue : tableGenerator .pkColumnValue(); this.initialValue = tableGenerator.initialValue() != 0 ? tableGenerator.initialValue() : default_initial_value; this.allocationSize = tableGenerator.allocationSize(); }
/** * INTERNAL: */ public int getAllocationSize() { return m_tableGenerator.allocationSize(); }
String.valueOf( tabGen.allocationSize() ) ); idGen.addParam( MultipleHiLoPerTableGenerator.PK_VALUE_NAME, tabGen.pkColumnValue() ); idGen.addParam( TableHiLoGenerator.MAX_LO, String.valueOf( tabGen.allocationSize() - 1 ) );
annotation.setValue( "pkColumnValue", tableAnn.pkColumnValue() ); annotation.setValue( "initialValue", tableAnn.initialValue() ); annotation.setValue( "allocationSize", tableAnn.allocationSize() ); annotation.setValue( "uniqueConstraints", tableAnn.uniqueConstraints() ); return AnnotationFactory.create( annotation );
/** * @param locator * the java locator * @param annotation * the annotation * * @since 2.0.0 */ public TableGeneratorMetadataImpl(AbstractLocator locator, TableGenerator annotation) { this.locator = locator; this.catalog = annotation.catalog(); this.schema = annotation.schema(); this.table = annotation.table(); this.name = annotation.name(); this.pkColumnName = annotation.pkColumnName(); this.pkColumnValue = annotation.pkColumnValue(); this.valueColumnName = annotation.valueColumnName(); this.initialValue = annotation.initialValue(); this.allocationSize = annotation.allocationSize(); for (final UniqueConstraint constraint : annotation.uniqueConstraints()) { this.uniqueConstraints.add(new UniqueConstraintMetadataImpl(locator, constraint)); } }
/** * @param locator * the java locator * @param annotation * the annotation * * @since 2.0.0 */ public TableGeneratorMetadataImpl(AbstractLocator locator, TableGenerator annotation) { this.locator = locator; this.catalog = annotation.catalog(); this.schema = annotation.schema(); this.table = annotation.table(); this.name = annotation.name(); this.pkColumnName = annotation.pkColumnName(); this.pkColumnValue = annotation.pkColumnValue(); this.valueColumnName = annotation.valueColumnName(); this.initialValue = annotation.initialValue(); this.allocationSize = annotation.allocationSize(); for (final UniqueConstraint constraint : annotation.uniqueConstraints()) { this.uniqueConstraints.add(new UniqueConstraintMetadataImpl(locator, constraint)); } }
/** * @param locator * the java locator * @param annotation * the annotation * * @since 2.0.0 */ public TableGeneratorMetadataImpl(AbstractLocator locator, TableGenerator annotation) { this.locator = locator; this.catalog = annotation.catalog(); this.schema = annotation.schema(); this.table = annotation.table(); this.name = annotation.name(); this.pkColumnName = annotation.pkColumnName(); this.pkColumnValue = annotation.pkColumnValue(); this.valueColumnName = annotation.valueColumnName(); this.initialValue = annotation.initialValue(); this.allocationSize = annotation.allocationSize(); for (final UniqueConstraint constraint : annotation.uniqueConstraints()) { this.uniqueConstraints.add(new UniqueConstraintMetadataImpl(locator, constraint)); } }
/** * インスタンスを構築します。 * * @param entityMeta * エンティティのメタデータ * @param propertyMeta * 識別子を表すプロパティのメタデータ * @param tableGenerator * 識別子に付けられたアノテーション */ public TableIdGenerator(final EntityMeta entityMeta, final PropertyMeta propertyMeta, final TableGenerator tableGenerator) { super(entityMeta, propertyMeta, tableGenerator.allocationSize()); this.tableGenerator = tableGenerator; catalog = getCatalog(); schema = getSchema(); table = getTable(); pkColumnName = getPkColumnName(); pkColumnValue = getPkColumnValue(); valueColumnName = getValueColumnName(); updateSql = createUpdateSql(); selectSql = createSelectSql(); }
/** * インスタンスを構築します。 * * @param entityMeta * エンティティのメタデータ * @param propertyMeta * 識別子を表すプロパティのメタデータ * @param tableGenerator * 識別子に付けられたアノテーション */ public TableIdGenerator(final EntityMeta entityMeta, final PropertyMeta propertyMeta, final TableGenerator tableGenerator) { super(entityMeta, propertyMeta, tableGenerator.allocationSize()); this.tableGenerator = tableGenerator; catalog = getCatalog(); schema = getSchema(); table = getTable(); pkColumnName = getPkColumnName(); pkColumnValue = getPkColumnValue(); valueColumnName = getValueColumnName(); updateSql = createUpdateSql(); selectSql = createSelectSql(); }
public static JPATableGeneratorDescriptor extract(TableGenerator tableGenerator) { JPATableGeneratorDescriptor descriptor = new JPATableGeneratorDescriptor(); descriptor.setAllocationSize(tableGenerator.allocationSize()); descriptor.setInitialValue(tableGenerator.initialValue()); descriptor.setName(tableGenerator.name()); descriptor.setPkColumnName(tableGenerator.pkColumnName()); descriptor.setPkColumnValue(tableGenerator.pkColumnValue()); descriptor.setSchema(tableGenerator.schema()); descriptor.setTable(tableGenerator.table()); JPAUniqueConstraint[] constraints = extractConstraints(tableGenerator); descriptor.setUniqueConstraints(constraints); descriptor.setValueColumnName(tableGenerator.valueColumnName()); return descriptor; }
annotation.setValue( "pkColumnValue", tableAnn.pkColumnValue() ); annotation.setValue( "initialValue", tableAnn.initialValue() ); annotation.setValue( "allocationSize", tableAnn.allocationSize() ); annotation.setValue( "uniqueConstraints", tableAnn.uniqueConstraints() ); return AnnotationFactory.create( annotation );
annotation.setValue( "pkColumnValue", tableAnn.pkColumnValue() ); annotation.setValue( "initialValue", tableAnn.initialValue() ); annotation.setValue( "allocationSize", tableAnn.allocationSize() ); annotation.setValue( "uniqueConstraints", tableAnn.uniqueConstraints() ); return AnnotationFactory.create( annotation );
meta.setPrimaryKeyValue(gen.pkColumnValue()); meta.setInitialValue(gen.initialValue()); meta.setAllocate(gen.allocationSize()); meta.setSource(getSourceFile(), (el instanceof Class) ? el : null, meta.SRC_ANNOTATIONS);
annotation.setValue( "pkColumnValue", tableAnn.pkColumnValue() ); annotation.setValue( "initialValue", tableAnn.initialValue() ); annotation.setValue( "allocationSize", tableAnn.allocationSize() ); annotation.setValue( "uniqueConstraints", tableAnn.uniqueConstraints() ); return AnnotationFactory.create( annotation );
annotation.setValue( "pkColumnValue", tableAnn.pkColumnValue() ); annotation.setValue( "initialValue", tableAnn.initialValue() ); annotation.setValue( "allocationSize", tableAnn.allocationSize() ); annotation.setValue( "uniqueConstraints", tableAnn.uniqueConstraints() ); return AnnotationFactory.create( annotation );
meta.setPrimaryKeyValue(gen.pkColumnValue()); meta.setInitialValue(gen.initialValue()); meta.setAllocate(gen.allocationSize()); meta.setSource(getSourceFile(), (el instanceof Class) ? el : null, meta.SRC_ANNOTATIONS);