segmentColumnName = tableAnnot.pkColumnName(); valueColumnName = tableAnnot.valueColumnName();
); if ( !BinderHelper.isEmptyAnnotationValue( tableGeneratorAnnotation.pkColumnName() ) ) { definitionBuilder.addParam( org.hibernate.id.enhanced.TableGenerator.SEGMENT_COLUMN_PARAM, tableGeneratorAnnotation.pkColumnName() );
if ( !BinderHelper.isEmptyAnnotationValue( tableGeneratorAnnotation.pkColumnName() ) ) { definitionBuilder.addParam( MultipleHiLoPerTableGenerator.PK_COLUMN_NAME, tableGeneratorAnnotation.pkColumnName() );
annotation.setValue( "catalog", defaults.getSchema() ); annotation.setValue( "pkColumnName", tableAnn.pkColumnName() ); annotation.setValue( "valueColumnName", tableAnn.valueColumnName() ); annotation.setValue( "pkColumnValue", tableAnn.pkColumnValue() );
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(); }
StringBuilder sql = new StringBuilder("SELECT "); sql.append(_tg.valueColumnName()).append(" FROM ").append(_tg.table()); sql.append(" WHERE ").append(_tg.pkColumnName()).append(" = ? FOR UPDATE"); sql.append(" WHERE ").append(_tg.pkColumnName()).append("=?");
/** * INTERNAL: */ public String getPkColumnName() { return m_tableGenerator.pkColumnName(); }
/** * 採番テーブルの識別子のカラム名を返します。 * * @return 採番テーブルの識別子のカラム名 */ protected String getPkColumnName() { final String pkColumnName = tableGenerator.pkColumnName(); if (!StringUtil.isEmpty(pkColumnName)) { return pkColumnName; } return DEFAULT_PK_COLUMN_NAME; }
/** * 採番テーブルの識別子のカラム名を返します。 * * @return 採番テーブルの識別子のカラム名 */ protected String getPkColumnName() { final String pkColumnName = tableGenerator.pkColumnName(); if (!StringUtil.isEmpty(pkColumnName)) { return pkColumnName; } return DEFAULT_PK_COLUMN_NAME; }
idGen.addParam( org.hibernate.id.enhanced.TableGenerator.TABLE_PARAM, tabGen.table() ); if ( !BinderHelper.isDefault( tabGen.pkColumnName() ) ) { idGen.addParam( org.hibernate.id.enhanced.TableGenerator.SEGMENT_COLUMN_PARAM, tabGen.pkColumnName() ); if ( !BinderHelper.isDefault( tabGen.pkColumnName() ) ) { idGen.addParam( MultipleHiLoPerTableGenerator.PK_COLUMN_NAME, tabGen.pkColumnName() );
annotation.setValue( "catalog", defaults.getSchema() ); annotation.setValue( "pkColumnName", tableAnn.pkColumnName() ); annotation.setValue( "valueColumnName", tableAnn.valueColumnName() ); annotation.setValue( "pkColumnValue", tableAnn.pkColumnValue() );
/** * @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( "catalog", defaults.getSchema() ); annotation.setValue( "pkColumnName", tableAnn.pkColumnName() ); annotation.setValue( "valueColumnName", tableAnn.valueColumnName() ); annotation.setValue( "pkColumnValue", tableAnn.pkColumnValue() );
annotation.setValue( "catalog", defaults.getSchema() ); annotation.setValue( "pkColumnName", tableAnn.pkColumnName() ); annotation.setValue( "valueColumnName", tableAnn.valueColumnName() ); annotation.setValue( "pkColumnValue", tableAnn.pkColumnValue() );
meta.setSequencePlugin(SequenceMapping.IMPL_VALUE_TABLE); meta.setTable(toTableName(gen.schema(), gen.table())); meta.setPrimaryKeyColumn(gen.pkColumnName()); meta.setSequenceColumn(gen.valueColumnName()); meta.setPrimaryKeyValue(gen.pkColumnValue());
annotation.setValue( "catalog", defaults.getSchema() ); annotation.setValue( "pkColumnName", tableAnn.pkColumnName() ); annotation.setValue( "valueColumnName", tableAnn.valueColumnName() ); annotation.setValue( "pkColumnValue", tableAnn.pkColumnValue() );
meta.setSequencePlugin(SequenceMapping.IMPL_VALUE_TABLE); meta.setTableIdentifier(toTableIdentifier(gen.schema(), gen.table())); meta.setPrimaryKeyColumnIdentifier(DBIdentifier.newColumn(gen.pkColumnName(), delimit())); meta.setSequenceColumnIdentifier(DBIdentifier.newColumn(gen.valueColumnName(),delimit())); meta.setPrimaryKeyValue(gen.pkColumnValue());