segmentValue = tableAnnot.pkColumnValue(); tableName = tableAnnot.table(); segmentColumnName = tableAnnot.pkColumnName();
); if ( !BinderHelper.isEmptyAnnotationValue( tableGeneratorAnnotation.pkColumnValue() ) ) { definitionBuilder.addParam( org.hibernate.id.enhanced.TableGenerator.SEGMENT_VALUE_PARAM, tableGeneratorAnnotation.pkColumnValue() );
); if ( !BinderHelper.isEmptyAnnotationValue( tableGeneratorAnnotation.pkColumnValue() ) ) { definitionBuilder.addParam( MultipleHiLoPerTableGenerator.PK_VALUE_NAME, tableGeneratorAnnotation.pkColumnValue() );
public <T> T getNextSequence(Class<T> clazz, TableGenerator tg, Object key, boolean isRandom) { Future<T> future = _executors.submit(new Fetcher<T>(clazz, tg, key, isRandom)); try { return future.get(); } catch (Exception e) { s_logger.warn("Unable to get sequeunce for " + tg.table() + ":" + tg.pkColumnValue(), e); return null; } }
annotation.setValue( "pkColumnValue", tableAnn.pkColumnValue() ); annotation.setValue( "initialValue", tableAnn.initialValue() ); annotation.setValue( "allocationSize", tableAnn.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(); }
) { if (_key == null) { selectStmt.setString(1, _tg.pkColumnValue()); } else { selectStmt.setObject(1, _key); updateStmt.setString(3, _tg.pkColumnValue()); } else { updateStmt.setObject(3, _key);
/** * INTERNAL: */ public String getPkColumnValue() { return m_tableGenerator.pkColumnValue(); }
); if ( !BinderHelper.isDefault( tabGen.pkColumnValue() ) ) { idGen.addParam( org.hibernate.id.enhanced.TableGenerator.SEGMENT_VALUE_PARAM, tabGen.pkColumnValue() ); idGen.addParam( MultipleHiLoPerTableGenerator.VALUE_COLUMN_NAME, tabGen.valueColumnName() ); if ( !BinderHelper.isDefault( tabGen.pkColumnValue() ) ) { idGen.addParam( MultipleHiLoPerTableGenerator.PK_VALUE_NAME, tabGen.pkColumnValue() );
public <T> T getNextSequence(final Class<T> clazz, final TableGenerator tg, final Object key, final boolean isRandom) { final Future<T> future = _executors.submit(new Fetcher<>(clazz, tg, key, isRandom)); try { return future.get(); } catch (final Exception e) { s_logger.warn("Unable to get sequeunce for " + tg.table() + ":" + tg.pkColumnValue(), e); return null; } }
annotation.setValue( "pkColumnValue", tableAnn.pkColumnValue() ); annotation.setValue( "initialValue", tableAnn.initialValue() ); annotation.setValue( "allocationSize", tableAnn.allocationSize() );
/** * 採番テーブルの識別子の値を返します。 * * @return 採番テーブルの識別子の値 */ protected String getPkColumnValue() { final String pkColumnValue = tableGenerator.pkColumnValue(); if (!StringUtil.isEmpty(pkColumnValue)) { return pkColumnValue; } return entityMeta.getTableMeta().getName() + "_" + propertyMeta.getColumnMeta().getName(); }
/** * 採番テーブルの識別子の値を返します。 * * @return 採番テーブルの識別子の値 */ protected String getPkColumnValue() { final String pkColumnValue = tableGenerator.pkColumnValue(); if (!StringUtil.isEmpty(pkColumnValue)) { return pkColumnValue; } return entityMeta.getTableMeta().getName() + "_" + propertyMeta.getColumnMeta().getName(); }
/** * @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)); } }
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( "pkColumnValue", tableAnn.pkColumnValue() ); annotation.setValue( "initialValue", tableAnn.initialValue() ); annotation.setValue( "allocationSize", tableAnn.allocationSize() );
meta.setPrimaryKeyColumn(gen.pkColumnName()); meta.setSequenceColumn(gen.valueColumnName()); meta.setPrimaryKeyValue(gen.pkColumnValue()); meta.setInitialValue(gen.initialValue()); meta.setAllocate(gen.allocationSize());