EntityPersister getFactory - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for EntityPersister getFactory method.

This code example shows how to use the following methods:getFactory, getIdentifierType, getRootEntityName
		this.entityName = entityName;
		this.identifierType = identifierType;
		this.isBatchLoadable = batchLoadable;
		this.factory = factory;
		this.tenantId = tenantId;
		this.hashCode = generateHashCode();
	} 
 
	private int generateHashCode() { 
		int result = 17;
		result = 37 * result + rootEntityName.hashCode();
		result = 37 * result + identifierType.getHashCode( identifier, factory );
		return result;
	} 
 
	public boolean isBatchLoadable() { 
		return isBatchLoadable;
	} 
 
	public Serializable getIdentifier() {
5
CodeRank
This code example shows how to use the following methods:getEntityName, getFactory, isVersioned, getRootTableIdentifierColumnNames, getRootTableName
		registerColumnType( Types.CHAR, "char(1)" );
		registerColumnType( Types.VARCHAR, "varchar($l)" );
		registerColumnType( Types.FLOAT, "float" );
		registerColumnType( Types.DOUBLE, "double precision" );
		registerColumnType( Types.DATE, "date" );
		registerColumnType( Types.TIME, "time" );
		registerColumnType( Types.TIMESTAMP, "timestamp" );
		//the BLOB type requires a size arguement - this defaults to 
		//bytes - no arg defaults to 1 whole byte! 
		//other argument mods include K - kilobyte, M - megabyte, G - gigabyte. 
		//refer to the PBdevelopers guide for more info. 
		registerColumnType( Types.VARBINARY, "blob($l)" );
		registerColumnType( Types.NUMERIC, "numeric($p,$s)" );
	} 
 
	public String getAddColumnString() {
		return "add"; 
	} 
 
	public boolean dropConstraints() { 

8
CodeRank
This code example shows how to use the following methods:getEntityName, getFactory, isVersioned, getRootTableIdentifierColumnNames, getRootTableName
public class FrontBaseDialect extends Dialect {
 
	public FrontBaseDialect() { 
		super(); 
 
		registerColumnType( Types.BIT, "bit" );
		registerColumnType( Types.BIGINT, "longint" );
		registerColumnType( Types.SMALLINT, "smallint" );
		registerColumnType( Types.TINYINT, "tinyint" );
		registerColumnType( Types.INTEGER, "integer" );
		registerColumnType( Types.CHAR, "char(1)" );
		registerColumnType( Types.VARCHAR, "varchar($l)" );
		registerColumnType( Types.FLOAT, "float" );
		registerColumnType( Types.DOUBLE, "double precision" );
		registerColumnType( Types.DATE, "date" );
		registerColumnType( Types.TIME, "time" );
		registerColumnType( Types.TIMESTAMP, "timestamp" );
		registerColumnType( Types.VARBINARY, "bit varying($l)" );
		registerColumnType( Types.NUMERIC, "numeric($p,$s)" );
		registerColumnType( Types.BLOB, "blob" );

8
CodeRank
This code example shows how to use the following methods:getEntityName, getFactory, isVersioned, getRootTableIdentifierColumnNames, getRootTableName
		registerColumnType( Types.SMALLINT, "smallint" );
		registerColumnType( Types.TINYINT, "tinyint" );
		registerColumnType( Types.INTEGER, "integer" );
		registerColumnType( Types.CHAR, "char(1)" );
		registerColumnType( Types.VARCHAR, "varchar($l)" );
		registerColumnType( Types.FLOAT, "float" );
		registerColumnType( Types.DOUBLE, "double" );
		registerColumnType( Types.DATE, "date" );
		registerColumnType( Types.TIME, "time" );
		registerColumnType( Types.TIMESTAMP, "timestamp" );
		registerColumnType( Types.VARBINARY, "varbinary" );
		registerColumnType( Types.NUMERIC, "numeric" );
		registerColumnType( Types.BLOB, "blob" );
		registerColumnType( Types.CLOB, "clob" );
 
		registerFunction( "upper", new StandardSQLFunction("upper") );
		registerFunction( "lower", new StandardSQLFunction("lower") );
		registerFunction( "sqrt", new StandardSQLFunction("sqrt", StandardBasicTypes.DOUBLE) );
		registerFunction( "abs", new StandardSQLFunction("abs") );
		registerFunction( "sign", new StandardSQLFunction( "sign", StandardBasicTypes.INTEGER ) );

8
CodeRank
This code example shows how to use the following methods:getFactory, getIdentifierPropertyName, getVersionProperty, isVersioned

6
CodeRank
This code example shows how to use the following methods:getEntityName, getFactory, isVersioned, getRootTableIdentifierColumnNames, getRootTableName
 * No CLOB/BLOB support  
 * No cascade delete support. 
 * No Calendar support 
 * No support for updating primary keys. 
 *  
 * @author Sherry Listgarten and Max Andersen 
 */ 
public class TimesTenDialect extends Dialect {
	 
	public TimesTenDialect() { 
		super(); 
		registerColumnType( Types.BIT, "TINYINT" );
		registerColumnType( Types.BIGINT, "BIGINT" );
		registerColumnType( Types.SMALLINT, "SMALLINT" );
		registerColumnType( Types.TINYINT, "TINYINT" );
		registerColumnType( Types.INTEGER, "INTEGER" );
		registerColumnType( Types.CHAR, "CHAR(1)" );
		registerColumnType( Types.VARCHAR, "VARCHAR($l)" );
		registerColumnType( Types.FLOAT, "FLOAT" );
		registerColumnType( Types.DOUBLE, "DOUBLE" );

8
CodeRank
This code example shows how to use the following methods:getEntityName, getFactory, isVersioned, getRootTableIdentifierColumnNames, getRootTableName
 * 1.1 
 * 1.0  2005-10-24  CDH - First dated version for use with CP 11 
 * 
 * @author Ploski and Hanson 
 */ 
public class RDMSOS2200Dialect extends Dialect { 
 
    private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, RDMSOS2200Dialect.class.getName()); 
 
	public RDMSOS2200Dialect() { 
		super(); 
        // Display the dialect version. 
        LOG.rdmsOs2200Dialect(); 
 
        /** 
         * This section registers RDMS Biult-in Functions (BIFs) with Hibernate. 
         * The first parameter is the 'register' function name with Hibernate. 
         * The second parameter is the defined RDMS SQL Function and it's 
         * characteristics. If StandardSQLFunction(...) is used, the RDMS BIF 
         * name and the return type (if any) is specified.  If 

8
CodeRank
This code example shows how to use the following methods:getFactory, getIdentifierType
	private volatile MapDatastoreProvider provider;
 
	public MapPessimisticWriteLockingStrategy(Lockable lockable, LockMode lockMode) {
		this.lockable = lockable;
		this.lockMode = lockMode;
		TypeTranslator typeTranslator = lockable.getFactory().getServiceRegistry().getService( TypeTranslator.class );
		this.identifierGridType = typeTranslator.getType( lockable.getIdentifierType() );
	} 
 
	@Override 
	public void lock(Serializable id, Object version, Object object, int timeout, SessionImplementor session) throws StaleObjectStateException, JDBCException {
		MapDatastoreProvider dataStore = getProvider( session );
		EntityKey key = EntityKeyBuilder.fromData(
				( (OgmEntityPersister) lockable).getRootEntityKeyMetadata(),
				identifierGridType,
				id,
				session );
		dataStore.writeLock( key, timeout );
		// FIXME check the version number as well and raise an optimistic lock exception if there is an issue JPA 2 spec: 3.4.4.2 
		// (Comment by Emmanuel) 
4
CodeRank
This code example shows how to use the following methods:getFactory, getIdentifierType
			final EntityMode entityMode,
			final String tenantId,
			final boolean disableVersionIncrement,
			final boolean lazyPropertiesAreUnfetched) {
		this.status=status;
		this.previousStatus = null;
		// only retain loaded state if the status is not Status.READ_ONLY 
		if ( status != Status.READ_ONLY ) { this.loadedState = loadedState; }
		this.id=id;
		this.rowId=rowId;
		this.existsInDatabase=existsInDatabase;
		this.version=version;
		this.lockMode=lockMode;
		this.isBeingReplicated=disableVersionIncrement;
		this.loadedWithLazyPropertiesUnfetched = lazyPropertiesAreUnfetched;
		this.persister=persister;
		this.entityMode = entityMode;
		this.tenantId = tenantId;
		this.entityName = persister == null ? null : persister.getEntityName();
	} 
5
CodeRank
getFactory Method Overview
Return the SessionFactory to which this persister "belongs".
See Code Examples for other Hibernate ORM EntityPersister Methods: