FileDocCategorySizeDatePackage
CustomPersister.javaAPI DocHibernate 3.2.514503Fri Jan 19 05:55:08 GMT 2007org.hibernate.test.legacy

CustomPersister

public class CustomPersister extends Object implements org.hibernate.persister.entity.EntityPersister

Fields Summary
private static final Hashtable
INSTANCES
private static final org.hibernate.id.IdentifierGenerator
GENERATOR
private org.hibernate.engine.SessionFactoryImplementor
factory
private static final org.hibernate.type.Type[]
TYPES
private static final String[]
NAMES
private static final boolean[]
MUTABILITY
private static final boolean[]
GENERATION
Constructors Summary
public CustomPersister(org.hibernate.mapping.PersistentClass model, org.hibernate.cache.CacheConcurrencyStrategy cache, org.hibernate.engine.SessionFactoryImplementor factory, org.hibernate.engine.Mapping mapping)


	 
			 
			 
			 
			  
		this.factory = factory;
	
Methods Summary
public voidafterInitialize(java.lang.Object entity, boolean fetched, org.hibernate.engine.SessionImplementor session)

	
public voidafterReassociate(java.lang.Object entity, org.hibernate.engine.SessionImplementor session)

	
public voidapplyFilters(org.hibernate.sql.QuerySelect select, java.lang.String alias, java.util.Map filters)

	
public voidapplyFilters(org.hibernate.sql.Select select, java.lang.String alias, java.util.Map filters)

	
public booleancanExtractIdOutOfEntity()

		return true;
	
private voidcheckEntityMode(org.hibernate.EntityMode entityMode)

		if ( EntityMode.POJO != entityMode ) {
			throw new IllegalArgumentException( "Unhandled EntityMode : " + entityMode );
		}
	
public java.lang.ObjectcreateProxy(java.io.Serializable id, org.hibernate.engine.SessionImplementor session)

		throw new UnsupportedOperationException("no proxy for this class");
	
public voiddelete(java.io.Serializable id, java.lang.Object version, java.lang.Object object, org.hibernate.engine.SessionImplementor session)


		INSTANCES.remove(id);
	
public int[]findDirty(java.lang.Object[] x, java.lang.Object[] y, java.lang.Object owner, org.hibernate.engine.SessionImplementor session)

		if ( !EqualsHelper.equals( x[0], y[0] ) ) {
			return new int[] { 0 };
		}
		else {
			return null;
		}
	
public int[]findModified(java.lang.Object[] x, java.lang.Object[] y, java.lang.Object owner, org.hibernate.engine.SessionImplementor session)

		if ( !EqualsHelper.equals( x[0], y[0] ) ) {
			return new int[] { 0 };
		}
		else {
			return null;
		}
	
public java.lang.ObjectforceVersionIncrement(java.io.Serializable id, java.lang.Object currentVersion, org.hibernate.engine.SessionImplementor session)

		return null;
	
public org.hibernate.cache.CacheConcurrencyStrategygetCache()

see
EntityPersister#getCache()

		return null;
	
public org.hibernate.cache.entry.CacheEntryStructuregetCacheEntryStructure()

		return new UnstructuredCacheEntry();
	
public org.hibernate.metadata.ClassMetadatagetClassMetadata()

see
EntityPersister#getClassMetadata()

		return null;
	
public java.lang.ClassgetConcreteProxyClass(org.hibernate.EntityMode entityMode)

		checkEntityMode( entityMode );
		return Custom.class;
	
public java.lang.ObjectgetCurrentVersion(java.io.Serializable id, org.hibernate.engine.SessionImplementor session)


		return INSTANCES.get(id);
	
public java.lang.Object[]getDatabaseSnapshot(java.io.Serializable id, org.hibernate.engine.SessionImplementor session)

		return null;
	
public org.hibernate.tuple.entity.EntityMetamodelgetEntityMetamodel()

		return null;
	
public java.lang.StringgetEntityName()

		return Custom.class.getName();
	
public org.hibernate.engine.SessionFactoryImplementorgetFactory()

		return factory;
	
public java.io.SerializablegetIdentifier(java.lang.Object object, org.hibernate.EntityMode entityMode)

		checkEntityMode( entityMode );
		return ( (Custom) object ).id;
	
public org.hibernate.id.IdentifierGeneratorgetIdentifierGenerator()

see
EntityPersister#getIdentifierGenerator()

		return GENERATOR;
	
public java.lang.StringgetIdentifierPropertyName()

see
EntityPersister#getIdentifierPropertyName()

		return "id";
	
public org.hibernate.type.TypegetIdentifierType()

see
EntityPersister#getIdentifierType()

		return Hibernate.STRING;
	
public java.lang.ClassgetMappedClass(org.hibernate.EntityMode entityMode)

		checkEntityMode( entityMode );
		return Custom.class;
	
public java.lang.ClassgetMappedClass()

		return Custom.class;
	
public int[]getNaturalIdentifierProperties()

		return null;
	
public java.lang.Object[]getNaturalIdentifierSnapshot(java.io.Serializable id, org.hibernate.engine.SessionImplementor session)

		return null;
	
public org.hibernate.type.Type[]getNaturalIdentifierTypes()

		return null;
	
public org.hibernate.engine.CascadeStyle[]getPropertyCascadeStyles()

see
EntityPersister#getPropertyCascadeStyles()

		return null;
	
public boolean[]getPropertyCheckability()

		return MUTABILITY;
	
public org.hibernate.engine.ValueInclusion[]getPropertyInsertGenerationInclusions()

		return new ValueInclusion[0];
	
public boolean[]getPropertyInsertability()

see
EntityPersister#getPropertyInsertability()

		return MUTABILITY;
	
public boolean[]getPropertyLaziness()

		return null;
	
public java.lang.String[]getPropertyNames()

see
EntityPersister#getPropertyNames()

		return NAMES;
	
public boolean[]getPropertyNullability()

		return MUTABILITY;
	
public java.io.Serializable[]getPropertySpaces()

		return new String[] { "CUSTOMS" };
	
public org.hibernate.type.TypegetPropertyType(java.lang.String propertyName)

		throw new UnsupportedOperationException();
	
public org.hibernate.type.Type[]getPropertyTypes()

see
EntityPersister#getPropertyTypes()


	  	 
	   
		return TYPES;
	
public org.hibernate.engine.ValueInclusion[]getPropertyUpdateGenerationInclusions()

		return new ValueInclusion[0];
	
public boolean[]getPropertyUpdateability()

		return MUTABILITY;
	
public java.lang.ObjectgetPropertyValue(java.lang.Object object, int i, org.hibernate.EntityMode entityMode)

		checkEntityMode( entityMode );
		return ( (Custom) object ).getName();
	
public java.lang.ObjectgetPropertyValue(java.lang.Object object, java.lang.String propertyName, org.hibernate.EntityMode entityMode)

		checkEntityMode( entityMode );
		return ( (Custom) object ).getName();
	
public java.lang.ObjectgetPropertyValue(java.lang.Object object, java.lang.String propertyName)

		throw new UnsupportedOperationException();
	
public java.lang.Object[]getPropertyValues(java.lang.Object object, org.hibernate.EntityMode entityMode)

		checkEntityMode( entityMode );
		Custom c = (Custom) object;
		return new Object[] { c.getName() };
	
public java.lang.Object[]getPropertyValuesToInsert(java.lang.Object object, java.util.Map mergeMap, org.hibernate.engine.SessionImplementor session)

		return getPropertyValues( object, session.getEntityMode() );
	
public boolean[]getPropertyVersionability()

		return MUTABILITY;
	
public java.io.Serializable[]getQuerySpaces()

		return new String[] { "CUSTOMS" };
	
public java.lang.StringgetRootEntityName()

see
EntityPersister#getRootEntityName()

		return "CUSTOMS";
	
public org.hibernate.persister.entity.EntityPersistergetSubclassEntityPersister(java.lang.Object instance, org.hibernate.engine.SessionFactoryImplementor factory, org.hibernate.EntityMode entityMode)

		checkEntityMode( entityMode );
		return this;
	
public java.lang.ObjectgetVersion(java.lang.Object object, org.hibernate.EntityMode entityMode)

		checkEntityMode( entityMode );
		return null;
	
public java.util.ComparatorgetVersionComparator()

		return null;
	
public intgetVersionProperty()

see
EntityPersister#getVersionProperty()

		return 0;
	
public org.hibernate.type.VersionTypegetVersionType()

see
EntityPersister#getVersionType()

		return null;
	
public org.hibernate.EntityModeguessEntityMode(java.lang.Object object)

		if ( !isInstance(object, EntityMode.POJO) ) {
			return null;
		}
		else {
			return EntityMode.POJO;
		}
	
public booleanhasCache()

see
EntityPersister#hasCache()

		return false;
	
public booleanhasCascades()

		return false;
	
public booleanhasCollections()

		return false;
	
public booleanhasGeneratedProperties()

		return false;
	
public booleanhasIdentifierProperty()

see
EntityPersister#hasIdentifierProperty()

		return true;
	
public booleanhasInsertGeneratedProperties()

		return false;
	
public booleanhasLazyProperties()

		return false;
	
public booleanhasMutableProperties()

		return false;
	
public booleanhasNaturalIdentifier()

		return false;
	
public booleanhasProxy()

		return false;
	
public booleanhasSubselectLoadableCollections()

		return false;
	
public booleanhasUninitializedLazyProperties(java.lang.Object object, org.hibernate.EntityMode entityMode)

		checkEntityMode( entityMode );
		return false;
	
public booleanhasUpdateGeneratedProperties()

		return false;
	
public booleanimplementsLifecycle(org.hibernate.EntityMode entityMode)

		checkEntityMode( entityMode );
		return false;
	
public booleanimplementsValidatable(org.hibernate.EntityMode entityMode)

		checkEntityMode( entityMode );
		return false;
	
public voidinsert(java.io.Serializable id, java.lang.Object[] fields, java.lang.Object object, org.hibernate.engine.SessionImplementor session)


		INSTANCES.put(id, ( (Custom) object ).clone() );
	
public java.io.Serializableinsert(java.lang.Object[] fields, java.lang.Object object, org.hibernate.engine.SessionImplementor session)


		throw new UnsupportedOperationException();
	
public java.lang.Objectinstantiate(java.io.Serializable id, org.hibernate.EntityMode entityMode)

		checkEntityMode( entityMode );
		Custom c = new Custom();
		c.id = (String) id;
		return c;
	
public booleanisBatchLoadable()

		return false;
	
public booleanisCacheInvalidationRequired()

		return false;
	
public booleanisDynamic()

		return false;
	
public booleanisIdentifierAssignedByInsert()

		return false;
	
public booleanisInherited()

		return false;
	
public booleanisInstance(java.lang.Object object, org.hibernate.EntityMode entityMode)

		checkEntityMode( entityMode );
		return object instanceof Custom;
	
public booleanisInstrumented(org.hibernate.EntityMode entityMode)

		return false;
	
public booleanisLazyPropertiesCacheable()

		return true;
	
public booleanisMutable()

		return true;
	
public booleanisSelectBeforeUpdateRequired()

		return false;
	
public booleanisSubclassEntityName(java.lang.String entityName)

		return Custom.class.getName().equals(entityName);
	
public java.lang.BooleanisTransient(java.lang.Object object, org.hibernate.engine.SessionImplementor session)

		return new Boolean( ( (Custom) object ).id==null );
	
public booleanisVersionPropertyGenerated()

		return false;
	
public booleanisVersioned()

see
EntityPersister#isVersioned()

		return false;
	
public java.lang.Objectload(java.io.Serializable id, java.lang.Object optionalObject, org.hibernate.LockMode lockMode, org.hibernate.engine.SessionImplementor session)

see
EntityPersister#load(Serializable, Object, LockMode, SessionImplementor)


		// fails when optional object is supplied

		Custom clone = null;
		Custom obj = (Custom) INSTANCES.get(id);
		if (obj!=null) {
			clone = (Custom) obj.clone();
			TwoPhaseLoad.addUninitializedEntity(
					new EntityKey( id, this, session.getEntityMode() ),
					clone,
					this,
					LockMode.NONE,
					false,
					session
				);
			TwoPhaseLoad.postHydrate(
					this, id,
					new String[] { obj.getName() },
					null,
					clone,
					LockMode.NONE,
					false,
					session
				);
			TwoPhaseLoad.initializeEntity(
					clone,
					false,
					session,
					new PreLoadEvent( (EventSource) session ),
					new PostLoadEvent( (EventSource) session )
				);
		}
		return clone;
	
public voidlock(java.io.Serializable id, java.lang.Object version, java.lang.Object object, org.hibernate.LockMode lockMode, org.hibernate.engine.SessionImplementor session)

see
EntityPersister#lock(Serializable, Object, Object, LockMode, SessionImplementor)


		throw new UnsupportedOperationException();
	
public voidpostInstantiate()

public voidprocessInsertGeneratedProperties(java.io.Serializable id, java.lang.Object entity, java.lang.Object[] state, org.hibernate.engine.SessionImplementor session)

	
public voidprocessUpdateGeneratedProperties(java.io.Serializable id, java.lang.Object entity, java.lang.Object[] state, org.hibernate.engine.SessionImplementor session)

	
public voidresetIdentifier(java.lang.Object entity, java.io.Serializable currentId, java.lang.Object currentVersion, org.hibernate.EntityMode entityMode)

		checkEntityMode( entityMode );
		( ( Custom ) entity ).id = ( String ) currentId;
	
public voidretrieveGeneratedProperties(java.io.Serializable id, java.lang.Object entity, java.lang.Object[] state, org.hibernate.engine.SessionImplementor session)

		throw new UnsupportedOperationException();
	
public voidsetIdentifier(java.lang.Object object, java.io.Serializable id, org.hibernate.EntityMode entityMode)

		checkEntityMode( entityMode );
		( (Custom) object ).id = (String) id;
	
public voidsetPropertyValue(java.lang.Object object, int i, java.lang.Object value, org.hibernate.EntityMode entityMode)

		checkEntityMode( entityMode );
		( (Custom) object ).setName( (String) value );
	
public voidsetPropertyValues(java.lang.Object object, java.lang.Object[] values, org.hibernate.EntityMode entityMode)

		checkEntityMode( entityMode );
		setPropertyValue( object, 0, values[0], entityMode );
	
public voidupdate(java.io.Serializable id, java.lang.Object[] fields, int[] dirtyFields, boolean hasDirtyCollection, java.lang.Object[] oldFields, java.lang.Object oldVersion, java.lang.Object object, java.lang.Object rowId, org.hibernate.engine.SessionImplementor session)

see
EntityPersister


		INSTANCES.put( id, ( (Custom) object ).clone() );