id.setNullValue( "undefined" );
identifierValue.setNullValue( unsavedValue ); identifierValue.setNullValue( "undefined" ); identifierValue.setNullValue( null );
versionValue.setNullValue( versionAttributeSource.getUnsavedValue() ); versionValue.setNullValue( "undefined" );
id.setNullValue( "undefined" );
private static final void makeVersion(Element node, SimpleValue model) { // VERSION UNSAVED-VALUE Attribute nullValueNode = node.attribute( "unsaved-value" ); if ( nullValueNode != null ) { model.setNullValue( nullValueNode.getValue() ); } else { model.setNullValue( "undefined" ); } }
private static final void makeVersion(Element node, SimpleValue model) { // VERSION UNSAVED-VALUE Attribute nullValueNode = node.attribute( "unsaved-value" ); if ( nullValueNode != null ) { model.setNullValue( nullValueNode.getValue() ); } else { model.setNullValue( "undefined" ); } }
private static final void makeVersion(Element node, SimpleValue model) { // VERSION UNSAVED-VALUE Attribute nullValueNode = node.attribute( "unsaved-value" ); if ( nullValueNode != null ) { model.setNullValue( nullValueNode.getValue() ); } else { model.setNullValue( "undefined" ); } }
simpleValue.setNullValue( "undefined" ); rootClass.setOptimisticLockStyle( OptimisticLockStyle.VERSION ); if ( traceEnabled ) {
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 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); }
private static void bindVersion(GrailsDomainClassProperty version, RootClass entity, Mappings mappings, String sessionFactoryBeanName) { SimpleValue val = new SimpleValue(mappings, entity.getTable()); bindSimpleValue(version, null, val, EMPTY_PATH, mappings, sessionFactoryBeanName); if (val.isTypeSpecified()) { if (!(val.getType() instanceof IntegerType || val.getType() instanceof LongType || val.getType() instanceof TimestampType)) { LOG.warn("Invalid version class specified in " + version.getDomainClass().getClazz().getName() + "; must be one of [int, Integer, long, Long, Timestamp, Date]. Not mapping the version."); return; } } else { val.setTypeName("version".equals(version.getName()) ? "integer" : "timestamp"); } Property prop = new Property(); prop.setValue(val); bindProperty(version, prop, mappings); val.setNullValue("undefined"); entity.setVersion(prop); entity.addProperty(prop); }
protected void bindVersion(PersistentProperty version, RootClass entity, Mappings mappings, String sessionFactoryBeanName) { if(version != null) { SimpleValue val = new SimpleValue(mappings, entity.getTable()); bindSimpleValue(version, null, val, EMPTY_PATH, mappings, sessionFactoryBeanName); if (val.isTypeSpecified()) { if (!(val.getType() instanceof IntegerType || val.getType() instanceof LongType || val.getType() instanceof TimestampType)) { LOG.warn("Invalid version class specified in " + version.getOwner().getName() + "; must be one of [int, Integer, long, Long, Timestamp, Date]. Not mapping the version."); return; } } else { val.setTypeName("version".equals(version.getName()) ? "integer" : "timestamp"); } Property prop = new Property(); prop.setValue(val); bindProperty(version, prop, mappings); val.setNullValue("undefined"); entity.setVersion(prop); entity.setOptimisticLockMode(0); // 0 is to use version column entity.addProperty(prop); } }
id.setNullValue("undefined");
simpleValue.setNullValue( "undefined" ); rootClass.setOptimisticLockMode( Versioning.OPTIMISTIC_LOCK_VERSION ); log.trace(