Java Code Examples for org.hibernate.dialect.Dialect.getSequenceNextValString()

The following are Jave code examples for showing how to use getSequenceNextValString() of the org.hibernate.dialect.Dialect class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: lams   File: SequenceGenerator.java   View Source Code Vote up 10 votes
@Override
public void configure(Type type, Properties params, Dialect dialect) throws MappingException {
	ObjectNameNormalizer normalizer = ( ObjectNameNormalizer ) params.get( IDENTIFIER_NORMALIZER );
	sequenceName = normalizer.normalizeIdentifierQuoting(
			ConfigurationHelper.getString( SEQUENCE, params, "hibernate_sequence" )
	);
	parameters = params.getProperty( PARAMETERS );

	if ( sequenceName.indexOf( '.' ) < 0 ) {
		final String schemaName = normalizer.normalizeIdentifierQuoting( params.getProperty( SCHEMA ) );
		final String catalogName = normalizer.normalizeIdentifierQuoting( params.getProperty( CATALOG ) );
		sequenceName = Table.qualify(
				dialect.quote( catalogName ),
				dialect.quote( schemaName ),
				dialect.quote( sequenceName )
		);
	}
	else {
		// if already qualified there is not much we can do in a portable manner so we pass it
		// through and assume the user has set up the name correctly.
	}

	this.identifierType = type;
	sql = dialect.getSequenceNextValString( sequenceName );
}
 
Example 2
Project: lams   File: SequenceStructure.java   View Source Code Vote up 5 votes
public SequenceStructure(
		Dialect dialect,
		String sequenceName,
		int initialValue,
		int incrementSize,
		Class numberType) {
	this.sequenceName = sequenceName;
	this.initialValue = initialValue;
	this.incrementSize = incrementSize;
	this.numberType = numberType;
	sql = dialect.getSequenceNextValString( sequenceName );
}