com.bm.introspectors
Class EntityBeanIntrospector<T>

java.lang.Object
  extended by com.bm.introspectors.AbstractPersistentClassIntrospector<T>
      extended by com.bm.introspectors.EntityBeanIntrospector<T>
Type Parameters:
T - - the type of the class to inspect
All Implemented Interfaces:
Introspector<T>

public class EntityBeanIntrospector<T>
extends AbstractPersistentClassIntrospector<T>
implements Introspector<T>

This class inspects all relevant fields of an entity bean and holds the information.

Since:
07.10.2005
Author:
Daniel Wiese, Istvan Devai

Field Summary
 
Fields inherited from class com.bm.introspectors.AbstractPersistentClassIntrospector
fieldInfo, pkFieldInfo
 
Constructor Summary
EntityBeanIntrospector(java.lang.Class<T> toInspect)
          Constructor with the class to inspect.
 
Method Summary
 java.lang.String getDiscriminatorName()
           
 java.lang.Class<?> getDiscriminatorType()
          Returns discriminator type used for the class that is inspected by this object, or null if not used.
 java.lang.String getDiscriminatorValue()
           
 EmbeddedClassIntrospector<java.lang.Object> getEmbeddedPKClass()
          Returns the embeddedPKClass.
protected  org.apache.log4j.Logger getLogger()
          Returns the logger for this class.
 java.lang.String getPersistentClassName()
          Returns the name of the class to inspect.
 java.lang.Object getPrimaryKey(T entityBean)
          Returns the pk to delete one entity bean.
 java.lang.String getShemaName()
          Returns the tableName.
 java.lang.String getTableName()
          Returns the tableName.
 boolean hasEmbeddedPKClass()
          Returns the hasPKClass.
 boolean hasIdClass()
          Returns the hasPKClass.
 boolean hasSchema()
          Returns if a chema name is persent.
protected  void processAccessTypeField(java.lang.Class<T> toInspect)
          Overide the abstract implementation of this method, to handle with embedded classes
 boolean usesSingleTableInheritance()
           
 
Methods inherited from class com.bm.introspectors.AbstractPersistentClassIntrospector
extractGenerator, getField, getPersitentProperties, getPkFields, getPresistentFieldInfo, getPrimaryKeyInfo, getRepresentingClass, getTransientFields, processAccessTypeProperty, setField
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.bm.introspectors.Introspector
getField, getPersitentProperties, getPkFields, getPresistentFieldInfo, getPrimaryKeyInfo, setField
 

Constructor Detail

EntityBeanIntrospector

public EntityBeanIntrospector(java.lang.Class<T> toInspect)
Constructor with the class to inspect.

Parameters:
toInspect - - the class to inspect
Method Detail

processAccessTypeField

protected void processAccessTypeField(java.lang.Class<T> toInspect)
Overide the abstract implementation of this method, to handle with embedded classes

Overrides:
processAccessTypeField in class AbstractPersistentClassIntrospector<T>
Parameters:
toInspect - - the class to inspect
Since:
15.10.2005
See Also:
AbstractPersistentClassIntrospector.processAccessTypeField(java.lang.Class)

getPrimaryKey

public java.lang.Object getPrimaryKey(T entityBean)
Returns the pk to delete one entity bean.

Parameters:
entityBean - - the entity bean instance
Returns:
- return the pk or the pk class

getTableName

public java.lang.String getTableName()
Returns the tableName.

Returns:
Returns the tableName.

getShemaName

public java.lang.String getShemaName()
Returns the tableName.

Returns:
Returns the tableName.

hasSchema

public boolean hasSchema()
Returns if a chema name is persent.

Returns:
a chema name is persent.

getEmbeddedPKClass

public EmbeddedClassIntrospector<java.lang.Object> getEmbeddedPKClass()
Returns the embeddedPKClass.

Returns:
Returns the embeddedPKClass.

hasEmbeddedPKClass

public boolean hasEmbeddedPKClass()
Returns the hasPKClass.

Returns:
Returns the hasPKClass.

hasIdClass

public boolean hasIdClass()
Returns the hasPKClass.

Returns:
Returns the hasPKClass.

getPersistentClassName

public java.lang.String getPersistentClassName()
Returns the name of the class to inspect.


getLogger

protected org.apache.log4j.Logger getLogger()
Returns the logger for this class.

Specified by:
getLogger in class AbstractPersistentClassIntrospector<T>
Returns:

usesSingleTableInheritance

public boolean usesSingleTableInheritance()
Returns:
true when entity uses single-table inheritance strategy

getDiscriminatorName

public java.lang.String getDiscriminatorName()
Returns:
name of discriminator (column), or null if not used.

getDiscriminatorValue

public java.lang.String getDiscriminatorValue()
Returns:
discriminator value used for the class that is inspected by this object, or null if not used.

getDiscriminatorType

public java.lang.Class<?> getDiscriminatorType()
Returns discriminator type used for the class that is inspected by this object, or null if not used.

Returns:
one of Integer.class, String.class or Character.class


Copyright © 2008. All Rights Reserved.