table.setIdentifierValue( id ); id.setIdentifierGeneratorStrategy( generatorType ); || identifierGeneratorStrategy.equals( MultipleHiLoPerTableGenerator.class.getName() ); if ( generatorType == null || !avoidOverriding ) { id.setIdentifierGeneratorStrategy( identifierGeneratorStrategy );
identifierValue.setIdentifierGeneratorStrategy( generatorName );
table.setIdentifierValue( id ); id.setIdentifierGeneratorStrategy( generatorType ); Properties params = new Properties(); || identifierGeneratorStrategy.equals( MultipleHiLoPerTableGenerator.class.getName() ); if ( generatorType == null || !avoidOverriding ) { id.setIdentifierGeneratorStrategy( identifierGeneratorStrategy );
private void manageIncrementGenerator(Mappings mappings, Table tab, SimpleValue id, String entityName) { id.setIdentifierGeneratorStrategy("increment"); Properties params = new Properties(); params.put(PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER, mappings.getObjectNameNormalizer()); params.setProperty(PersistentIdentifierGenerator.SCHEMA, quoteIdentifier(tab.getSchema())); params.put(IncrementGenerator.ENTITY_NAME, entityName); id.setIdentifierGeneratorProperties(params); id.setNullValue(null); }
private void manageIncrementGenerator(Mappings mappings, Table tab, SimpleValue id, String entityName) { id.setIdentifierGeneratorStrategy("increment"); Properties params = new Properties(); params.put(PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER, mappings.getObjectNameNormalizer()); params.setProperty(PersistentIdentifierGenerator.SCHEMA, quoteIdentifier(tab.getSchema())); params.put(IncrementGenerator.ENTITY_NAME, entityName); id.setIdentifierGeneratorProperties(params); id.setNullValue(null); }
private void updatePrimaryKey(RootClass rc, PrimaryKeyInfo pki) { SimpleValue idValue = (SimpleValue) rc.getIdentifierProperty().getValue(); Properties defaultStrategyProperties = new Properties(); Property constrainedOneToOne = getConstrainedOneToOne(rc); if(constrainedOneToOne!=null) { if(pki.suggestedStrategy==null) { idValue.setIdentifierGeneratorStrategy("foreign"); } if(pki.suggestedProperties==null) { defaultStrategyProperties.setProperty("property", constrainedOneToOne.getName()); idValue.setIdentifierGeneratorProperties(defaultStrategyProperties); } } }
private void updatePrimaryKey(RootClass rc, PrimaryKeyInfo pki) { SimpleValue idValue = (SimpleValue) rc.getIdentifierProperty().getValue(); Properties defaultStrategyProperties = new Properties(); Property constrainedOneToOne = getConstrainedOneToOne(rc); if(constrainedOneToOne!=null) { if(pki.suggestedStrategy==null) { idValue.setIdentifierGeneratorStrategy("foreign"); } if(pki.suggestedProperties==null) { defaultStrategyProperties.setProperty("property", constrainedOneToOne.getName()); idValue.setIdentifierGeneratorProperties(defaultStrategyProperties); } } }
private void manageSequenceGenerator(Mappings mappings, Table tab, SimpleValue id, SequenceGenerator generator) { id.setIdentifierGeneratorStrategy ("enhanced-sequence"); Properties params = new Properties(); params.put(PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER, mappings.getObjectNameNormalizer()); params.put(SequenceStyleGenerator.SEQUENCE_PARAM, quoteIdentifier(generator.getName())); params.setProperty( SequenceStyleGenerator.SCHEMA, quoteIdentifier(tab.getSchema())); id.setIdentifierGeneratorProperties(params); id.setNullValue(null); }
private void manageSequenceGenerator(Mappings mappings, Table tab, SimpleValue id, SequenceGenerator generator) { id.setIdentifierGeneratorStrategy ("enhanced-sequence"); Properties params = new Properties(); params.put(PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER, mappings.getObjectNameNormalizer()); params.put(SequenceStyleGenerator.SEQUENCE_PARAM, quoteIdentifier(generator.getName())); params.setProperty( SequenceStyleGenerator.SCHEMA, quoteIdentifier(tab.getSchema())); id.setIdentifierGeneratorProperties(params); id.setNullValue(null); }
private void manageTableGenerator(Mappings mappings, Table tab, SimpleValue id, com.manydesigns.portofino.model.database.TableGenerator generator) { id.setIdentifierGeneratorStrategy("enhanced-table"); Properties params = new Properties(); params.put(TableGenerator.TABLE, tab); params.put(TableGenerator.TABLE_PARAM, quoteIdentifier(generator.getTable())); params.put(PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER, mappings.getObjectNameNormalizer()); params.put(TableGenerator.SEGMENT_COLUMN_PARAM, quoteIdentifier(generator.getKeyColumn())); params.put(TableGenerator.SEGMENT_VALUE_PARAM, generator.getKeyValue()); params.put(TableGenerator.VALUE_COLUMN_PARAM, quoteIdentifier(generator.getValueColumn())); params.setProperty( TableGenerator.SCHEMA, quoteIdentifier(tab.getSchema())); id.setIdentifierGeneratorProperties(params); id.setNullValue(null); }
private void manageTableGenerator(Mappings mappings, Table tab, SimpleValue id, com.manydesigns.portofino.model.database.TableGenerator generator) { id.setIdentifierGeneratorStrategy("enhanced-table"); Properties params = new Properties(); params.put(TableGenerator.TABLE, tab); params.put(TableGenerator.TABLE_PARAM, quoteIdentifier(generator.getTable())); params.put(PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER, mappings.getObjectNameNormalizer()); params.put(TableGenerator.SEGMENT_COLUMN_PARAM, quoteIdentifier(generator.getKeyColumn())); params.put(TableGenerator.SEGMENT_VALUE_PARAM, generator.getKeyValue()); params.put(TableGenerator.VALUE_COLUMN_PARAM, quoteIdentifier(generator.getValueColumn())); params.setProperty( TableGenerator.SCHEMA, quoteIdentifier(tab.getSchema())); id.setIdentifierGeneratorProperties(params); id.setNullValue(null); }
private void manageIdentityGenerator(Mappings mappings, Table tab, SimpleValue id) { id.setIdentifierGeneratorStrategy(PortofinoIdentityGenerator.class.getName()); //"identity"); Properties params = new Properties(); params.put(PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER, mappings.getObjectNameNormalizer()); if (mappings.getSchemaName() != null) { params.setProperty( PersistentIdentifierGenerator.SCHEMA, mappings.getObjectNameNormalizer().normalizeIdentifierQuoting(mappings.getSchemaName())); } if (mappings.getCatalogName() != null) { params.setProperty( PersistentIdentifierGenerator.CATALOG, mappings.getObjectNameNormalizer().normalizeIdentifierQuoting(mappings.getCatalogName())); } id.setIdentifierGeneratorProperties(params); id.setNullValue(null); }
private void manageIdentityGenerator(Mappings mappings, Table tab, SimpleValue id) { id.setIdentifierGeneratorStrategy(PortofinoIdentityGenerator.class.getName()); //"identity"); Properties params = new Properties(); params.put(PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER, mappings.getObjectNameNormalizer()); if (mappings.getSchemaName() != null) { params.setProperty( PersistentIdentifierGenerator.SCHEMA, mappings.getObjectNameNormalizer().normalizeIdentifierQuoting(mappings.getSchemaName())); } if (mappings.getCatalogName() != null) { params.setProperty( PersistentIdentifierGenerator.CATALOG, mappings.getObjectNameNormalizer().normalizeIdentifierQuoting(mappings.getCatalogName())); } id.setIdentifierGeneratorProperties(params); id.setNullValue(null); }
model.setIdentifierGeneratorStrategy( subnode.attributeValue( "class" ) );
model.setIdentifierGeneratorStrategy( subnode.attributeValue( "class" ) );
if ( subnode != null ) { final String generatorClass = subnode.attributeValue( "class" ); model.setIdentifierGeneratorStrategy( generatorClass );
id.setIdentifierGeneratorStrategy("native"); } else { id.setIdentifierGeneratorStrategy(mappedId.getGenerator()); params.putAll(mappedId.getParams()); if ("assigned".equals(mappedId.getGenerator())) {
id.setIdentifierGeneratorStrategy(useSequence ? "sequence-identity" : "native"); } else { String generator = mappedId.getGenerator(); generator = "sequence-identity"; id.setIdentifierGeneratorStrategy(generator); params.putAll(mappedId.getParams()); if ("assigned".equals(generator)) {
id.setIdentifierGeneratorStrategy("assigned"); id.setNullValue("undefined");
id.setIdentifierGeneratorStrategy("assigned"); id.setNullValue("undefined");