org.hibernate.id.IdentityGenerator Java Examples

The following examples show how to use org.hibernate.id.IdentityGenerator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultIdentifierGeneratorFactory.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a new DefaultIdentifierGeneratorFactory.
 */
@SuppressWarnings("deprecation")
public DefaultIdentifierGeneratorFactory() {
	register( "uuid2", UUIDGenerator.class );
	register( "guid", GUIDGenerator.class );			// can be done with UUIDGenerator + strategy
	register( "uuid", UUIDHexGenerator.class );			// "deprecated" for new use
	register( "uuid.hex", UUIDHexGenerator.class ); 	// uuid.hex is deprecated
	register( "assigned", Assigned.class );
	register( "identity", IdentityGenerator.class );
	register( "select", SelectGenerator.class );
	register( "sequence", SequenceStyleGenerator.class );
	register( "seqhilo", SequenceHiLoGenerator.class );
	register( "increment", IncrementGenerator.class );
	register( "foreign", ForeignGenerator.class );
	register( "sequence-identity", SequenceIdentityGenerator.class );
	register( "enhanced-sequence", SequenceStyleGenerator.class );
	register( "enhanced-table", TableGenerator.class );
}
 
Example #2
Source File: Dialect.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * The class (which implements {@link org.hibernate.id.IdentifierGenerator})
 * which acts as this dialects native generation strategy.
 * <p/>
 * Comes into play whenever the user specifies the native generator.
 *
 * @return The native generator class.
 * @deprecated use {@link #getNativeIdentifierGeneratorStrategy()} instead
 */
@Deprecated
public Class getNativeIdentifierGeneratorClass() {
	if ( getIdentityColumnSupport().supportsIdentityColumns() ) {
		return IdentityGenerator.class;
	}
	else {
		return SequenceStyleGenerator.class;
	}
}
 
Example #3
Source File: Dialect.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * The class (which implements {@link org.hibernate.id.IdentifierGenerator})
 * which acts as this dialects native generation strategy.
 * <p/>
 * Comes into play whenever the user specifies the native generator.
 *
 * @return The native generator class.
 */
public Class getNativeIdentifierGeneratorClass() {
	if ( supportsIdentityColumns() ) {
		return IdentityGenerator.class;
	}
	else if ( supportsSequences() ) {
		return SequenceGenerator.class;
	}
	else {
		return TableHiLoGenerator.class;
	}
}
 
Example #4
Source File: SimpleValue.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public boolean isIdentityColumn(IdentifierGeneratorFactory identifierGeneratorFactory, Dialect dialect) {
	identifierGeneratorFactory.setDialect( dialect );
	return IdentityGenerator.class.isAssignableFrom(identifierGeneratorFactory.getIdentifierGeneratorClass( identifierGeneratorStrategy ));
}
 
Example #5
Source File: SimpleValue.java    From cacheonix-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public boolean isIdentityColumn(Dialect dialect) {
	return IdentifierGeneratorFactory.getIdentifierGeneratorClass(identifierGeneratorStrategy, dialect)
			.equals(IdentityGenerator.class);
}
 
Example #6
Source File: Cache71Dialect.java    From cacheonix-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public Class getNativeIdentifierGeneratorClass() {
	return IdentityGenerator.class;
}