org.objectweb.speedo.naming.lib
Class OLongIdNamingManager
java.lang.Object
org.objectweb.speedo.naming.lib.NamingManagerHelper
org.objectweb.speedo.naming.lib.CommonLongIdNamingManager
org.objectweb.speedo.naming.lib.OLongIdNamingManager
- All Implemented Interfaces:
- NamingManager
public class OLongIdNamingManager
- extends CommonLongIdNamingManager
This is naming manager manages identifier based on a java.lang.Long value
generated by Speedo, using a persistent generator (Speedo structure in
database). The long value is composed of two parts. Some bits are used for
the class identifier, and the rest is used to identify the object instance
in the class. This identifier format supports very well the polymorphism.
The null reference is represented by the NULL value.The java.lang.Long field
can be a visible persistent field, otherwise it is hidden by Speedo/JORM
implementation.
- Author:
- S.Chassande-Barrioz
- See Also:
NamingManager
,
LongIdManager
Methods inherited from class org.objectweb.speedo.naming.lib.CommonLongIdNamingManager |
canProvidePBinder, canProvidePNamingContext, decode, defineClassIdentifierNameDef, defineClassReferenceNameDef, defineClassReferenceNameDef, defineGenClassIdentifierNameDef, defineGenClassReferenceNameDef, getDefaultColumn, getJormNamingConfig, getNamingfields, getPBinder, getPBinder, getPNameHints, getPNameHints2, getPNamingContext, init, needInheritanceDiscriminator, setCache, setLogger, setPmf, supportPNamingcontext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OLongIdNamingManager
public OLongIdNamingManager()
getLongIdName
protected java.lang.String getLongIdName()
- Specified by:
getLongIdName
in class CommonLongIdNamingManager
- Returns:
- the name of the composite name (JORM object) corresponding the
identifier.
getLongIdLid
protected java.lang.String getLongIdLid()
- Specified by:
getLongIdLid
in class CommonLongIdNamingManager
- Returns:
- the default name of the identifier field.
getFieldType
protected org.objectweb.jorm.type.api.PType getFieldType()
- Specified by:
getFieldType
in class CommonLongIdNamingManager
- Returns:
- the default jorm type of the identifier field.
getBasicOperand
protected org.objectweb.medor.expression.lib.BasicOperand getBasicOperand()
- Specified by:
getBasicOperand
in class CommonLongIdNamingManager
- Returns:
- the operand (Medor object) used for computing the class identifier
checkFieldType
protected boolean checkFieldType(java.lang.String type)
- Description copied from class:
CommonLongIdNamingManager
- Checks if the field type is the one expected
- Specified by:
checkFieldType
in class CommonLongIdNamingManager
- Parameters:
type
- is the field type as a string.
- Returns:
- true if this the right type.
getBinderForClass
protected java.lang.String getBinderForClass()
- Specified by:
getBinderForClass
in class CommonLongIdNamingManager
- Returns:
- Returns the bINDER_FOR_CLASS.
getBinderForGenClass
protected java.lang.String getBinderForGenClass()
- Specified by:
getBinderForGenClass
in class CommonLongIdNamingManager
- Returns:
- Returns the bINDER_FOR_GENCLASS.
decodeLong
protected org.objectweb.jorm.naming.api.PName decodeLong(org.objectweb.jorm.naming.api.PNameCoder pnc,
java.lang.String idStr)
throws org.objectweb.jorm.api.PException
- Description copied from class:
CommonLongIdNamingManager
- Decodes a string value into a PName.
- Specified by:
decodeLong
in class CommonLongIdNamingManager
- Parameters:
pnc
- is the PNameCoder able to decode the stringidStr
- is the string representation of an identifier
- Returns:
- a PName
- Throws:
org.objectweb.jorm.api.PException
getHiddenLidFieldName
protected java.lang.String getHiddenLidFieldName()
- Specified by:
getHiddenLidFieldName
in class CommonLongIdNamingManager
- Returns:
- Returns the hIDDEN_LID_FIELD_NAME.
getJavaFieldType
protected java.lang.Class getJavaFieldType()
- Specified by:
getJavaFieldType
in class CommonLongIdNamingManager
- Returns:
- the default java type of the identifier field.
getMapper
public org.objectweb.jorm.api.PMapper getMapper()
- Specified by:
getMapper
in class CommonLongIdNamingManager
- Returns:
- the mapper used
getName
protected java.lang.String getName()
- Specified by:
getName
in class NamingManagerHelper
newClassPBinder
public org.objectweb.jorm.naming.api.PBinder newClassPBinder(java.lang.String className,
java.lang.Object conn)
throws org.objectweb.jorm.api.PException
- Specified by:
newClassPBinder
in class CommonLongIdNamingManager
- Parameters:
className
- is the class name of the persistent classconn
- is the connection to the underlying persistent support.
- Returns:
- a new PBinder for managing class identifier.
- Throws:
org.objectweb.jorm.api.PException
newClassPNamingContext
public org.objectweb.jorm.naming.api.PNamingContext newClassPNamingContext()
throws org.objectweb.jorm.api.PException
- Specified by:
newClassPNamingContext
in class CommonLongIdNamingManager
- Returns:
- a new PBinder for managing class reference.
- Throws:
org.objectweb.jorm.api.PException
newGenClassPBinder
public org.objectweb.jorm.naming.api.PBinder newGenClassPBinder()
throws org.objectweb.jorm.api.PException
- Specified by:
newGenClassPBinder
in class CommonLongIdNamingManager
- Returns:
- a new PBinder for managing GenClass identifier.
- Throws:
org.objectweb.jorm.api.PException
setPMapper
public void setPMapper(org.objectweb.jorm.api.PMapper mapper)
- Specified by:
setPMapper
in interface NamingManager
- Overrides:
setPMapper
in class NamingManagerHelper
getLongIdManagerClass
public java.lang.Class getLongIdManagerClass()
- Specified by:
getLongIdManagerClass
in class CommonLongIdNamingManager
- Returns:
- the class of the IdManager used by this naming.
getPBinderClass
public java.lang.Class getPBinderClass()
- Specified by:
getPBinderClass
in class CommonLongIdNamingManager
- Returns:
- the class of the PBinder used by this naming.
getPNameClass
public java.lang.Class getPNameClass()
- Specified by:
getPNameClass
in class CommonLongIdNamingManager
- Returns:
- the class of the PName used by this naming.
getPNamingContextClass
public java.lang.Class getPNamingContextClass()
- Specified by:
getPNamingContextClass
in class CommonLongIdNamingManager
- Returns:
- the class of the PNamingContext used by this naming.
canManage
public boolean canManage(SpeedoClass sc)
- Description copied from interface:
NamingManager
- Indicates if the naming manager is able to manage the identifier of a
persistent class.
- Specified by:
canManage
in interface NamingManager
- Specified by:
canManage
in class CommonLongIdNamingManager
- Parameters:
sc
- The speedo meta object representing the persistent class
encode
public java.lang.Object encode(org.objectweb.jorm.naming.api.PName pn)
throws org.objectweb.jorm.api.PException
- Description copied from class:
CommonLongIdNamingManager
- Encodes a PName into a value.
- Specified by:
encode
in interface NamingManager
- Specified by:
encode
in class CommonLongIdNamingManager
- Parameters:
pn
- is the PName to encode
- Returns:
- the encoded PName
- Throws:
org.objectweb.jorm.api.PException
getGCPNameHints
public java.lang.String getGCPNameHints(SpeedoClass sc,
org.objectweb.jorm.metainfo.api.NameDef nd)
- Description copied from interface:
NamingManager
- compute a string value which permit to help the building of the genclass
PName (export)
- Parameters:
sc
- is the Speedo class which the hints must be specifiednd
- is the name def of the gen class