tableName = tableAnnot.table(); segmentColumnName = tableAnnot.pkColumnName(); valueColumnName = tableAnnot.valueColumnName();
AnnotationDescriptor annotation = new AnnotationDescriptor( TableGenerator.class ); annotation.setValue( "name", tableAnn.name() ); annotation.setValue( "table", tableAnn.table() ); annotation.setValue( "catalog", tableAnn.table() ); if ( StringHelper.isEmpty( (String) annotation.valueOf( "catalog" ) ) && StringHelper.isNotEmpty( defaults.getCatalog() ) ) { annotation.setValue( "catalog", defaults.getCatalog() ); annotation.setValue( "schema", tableAnn.table() ); if ( StringHelper.isEmpty( (String) annotation.valueOf( "schema" ) ) && StringHelper.isNotEmpty( defaults.getSchema() ) ) {
definitionBuilder.addParam( PersistentIdentifierGenerator.SCHEMA, tableGeneratorAnnotation.schema() ); if ( !BinderHelper.isEmptyAnnotationValue( tableGeneratorAnnotation.table() ) ) { definitionBuilder.addParam( org.hibernate.id.enhanced.TableGenerator.TABLE_PARAM, tableGeneratorAnnotation.table() );
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; } }
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(); }
public T call() throws Exception { 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(_tg.table()).append(" SET ").append(_tg.valueColumnName()).append("=").append("?+?"); sql.append(" WHERE ").append(_tg.pkColumnName()).append("=?");
/** * INTERNAL: */ public String getTable() { return m_tableGenerator.table(); }
AnnotationDescriptor annotation = new AnnotationDescriptor( TableGenerator.class ); annotation.setValue( "name", tableAnn.name() ); annotation.setValue( "table", tableAnn.table() ); annotation.setValue( "catalog", tableAnn.table() ); if ( StringHelper.isEmpty( (String) annotation.valueOf( "catalog" ) ) && StringHelper.isNotEmpty( defaults.getCatalog() ) ) { annotation.setValue( "catalog", defaults.getCatalog() ); annotation.setValue( "schema", tableAnn.table() ); if ( StringHelper.isEmpty( (String) annotation.valueOf( "schema" ) ) && StringHelper.isNotEmpty( defaults.getSchema() ) ) {
/** * 採番テーブル名を返します。 * * @return 採番テーブル名 */ protected String getTable() { final String table = tableGenerator.table(); if (!StringUtil.isEmpty(table)) { return table; } return DEFAULT_TABLE; }
/** * 採番テーブル名を返します。 * * @return 採番テーブル名 */ protected String getTable() { final String table = tableGenerator.table(); if (!StringUtil.isEmpty(table)) { return table; } return DEFAULT_TABLE; }
idGen.addParam( org.hibernate.id.enhanced.TableGenerator.SCHEMA, tabGen.schema() ); if ( !BinderHelper.isDefault( tabGen.table() ) ) { idGen.addParam( org.hibernate.id.enhanced.TableGenerator.TABLE_PARAM, tabGen.table() ); idGen.setIdentifierGeneratorStrategy( MultipleHiLoPerTableGenerator.class.getName() ); if ( !BinderHelper.isDefault( tabGen.table() ) ) { idGen.addParam( MultipleHiLoPerTableGenerator.ID_TABLE, tabGen.table() );
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; } }
/** * @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)); } }
AnnotationDescriptor annotation = new AnnotationDescriptor( TableGenerator.class ); annotation.setValue( "name", tableAnn.name() ); annotation.setValue( "table", tableAnn.table() ); annotation.setValue( "catalog", tableAnn.table() ); if ( StringHelper.isEmpty( (String) annotation.valueOf( "catalog" ) ) && StringHelper.isNotEmpty( defaults.getCatalog() ) ) { annotation.setValue( "catalog", defaults.getCatalog() ); annotation.setValue( "schema", tableAnn.table() ); if ( StringHelper.isEmpty( (String) annotation.valueOf( "schema" ) ) && StringHelper.isNotEmpty( defaults.getSchema() ) ) {
AnnotationDescriptor annotation = new AnnotationDescriptor( TableGenerator.class ); annotation.setValue( "name", tableAnn.name() ); annotation.setValue( "table", tableAnn.table() ); annotation.setValue( "catalog", tableAnn.table() ); if ( StringHelper.isEmpty( (String) annotation.valueOf( "catalog" ) ) && StringHelper.isNotEmpty( defaults.getCatalog() ) ) { annotation.setValue( "catalog", defaults.getCatalog() ); annotation.setValue( "schema", tableAnn.table() ); if ( StringHelper.isEmpty( (String) annotation.valueOf( "schema" ) ) && StringHelper.isNotEmpty( defaults.getSchema() ) ) {
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; }
meta.setTable(toTableName(gen.schema(), gen.table())); meta.setPrimaryKeyColumn(gen.pkColumnName()); meta.setSequenceColumn(gen.valueColumnName());