addMapperEventListener
public void addMapperEventListener(PMapperListener listener)
Adds the given mapper listener to this mapper. If it already exists,
does nothing.
listener
- The corresponding listener.
closeConnection
public void closeConnection(Object conn)
throws PException
Closes the given connection which has been allocated previously using
getConnection.
conn
- The concerned connection.
cn2mn
public String cn2mn(String cn)
Constructs a "mapped name" starting from a JORM class name. For example,
"foo" class name produces ".foo", while "p1.p2.foo"
produces "p1.p2..foo".
cn
- The JORM class name.
createGenClassMapping
public PClassMapping createGenClassMapping()
throws PException
Creates a new PClassMapping for a gen class. It instanciates the relevant
class wrt the type of mapper.
getConnection
public Object getConnection()
throws PException
Allocates a connection for accessing the underlying DS.
getConnection
public Object getConnection(Object ctxt)
throws PException
Allocates a connection for accessing the underlying DS knowing additional
context information.
ctxt
- Context information used to allocate the connection.
getConnection
public Object getConnection(Object connectionContext,
Object user)
throws PException
Allocates a connection for accessing the underlying DS knowing additional
context information.
connectionContext
- Context information used to allocate the connection.user
- is the identifier of the connection user (working set
or transaction id).
getConnectionFactory
public Object getConnectionFactory()
Returns the connection factory associated to this mapper.
getMapperName
public String getMapperName()
The name yielded by this method defines what kind of PMapper is used
on a particular DS.
- The name defining the PMapper kind.
getMetaInfoManager
public Manager getMetaInfoManager()
It retrieves a meta-information Manager that may used by a parser in order
to load the meta-information associated to JORM classes mapped within
this PMapper.
- The meta-information Manager assigned.
getPMappingStructuresManager
public PMappingStructuresManager getPMappingStructuresManager()
Retrieves the PMappingStructuresManager associated with this mapper.
- The associated PMappingStructuresManager.
getPTypeSpace
public PTypeSpace getPTypeSpace()
It returns a PTypeSpace that may be used to create PType
associated to JORM classes mapped within this PMapper.
getPrefetchCache
public PrefetchCache getPrefetchCache()
Returns the prefetch cache associated to this mapper. It can be null.
lookup
public PClassMapping lookup(String classname)
It looks for the PClassMapping object associated to a JORM class within
this PMapper.
- The PClassMapping that maps the corresponding class, or null if
none exists
map
public void map(Object conn,
PClassMapping pcm)
throws PException
It registers a PClassMapping associated to a particular JORM class within
this PMapper. It initializes the storage structures if necessary. It
previously removes them if the "dsrem" flag is set. If the mapper is
ready to manage the meta-information, it is loaded for this JORM class.
conn
- The connection to access to the underlying DS.pcm
- The class mapping to add to this mapper.
map
public void map(Object conn,
PClassMapping pcm,
boolean loadmeta)
throws PException
It registers a PClassMapping associated to a particular JORM class within
this PMapper. It initializes the storage structures if necessary. It
previously removes them if the "dsrem" flag is set. It also loads the
meta-information related to this class if the "loadmeta" flag is set.
conn
- The connection to access to the underlying DS.pcm
- The class mapping to add to this mapper.loadmeta
- It specifies that meta-information should be loaded for
this class to map.
map
public void map(PClassMapping pcm)
throws PException
It registers a PClassMapping associated to a particular JORM class within
this PMapper. It initializes the storage structures if necessary. It
previously removes them if the "dsrem" flag is set. If the mapper is
ready to manage the meta-information, it is loaded for this JORM class.
pcm
- The class mapping to add to this mapper.
removeMapperEventListener
public void removeMapperEventListener(PMapperListener listener)
Removes the given mapper listener from this mapper. If it is not
present among this list, does nothing.
listener
- The corresponding listener.
setConnectionFactory
public void setConnectionFactory(Object cf)
throws PException
Assigns a connection factory to this mapper.
setMapperName
public void setMapperName(String mappername)
It assigns the name of the mapper that is instanciated. It is mandatory
to assign it at mapper initialization as the load of meta-information
depends on it.
mappername
- The name of the mapper.
setPrefetchCache
public void setPrefetchCache(PrefetchCache pc)
throws PException
Assigns a prefetch cache to this mapper. It is optional.
unmap
public void unmap(String classname)
throws PException
It unmaps a particular JORM class within this PMapper.
classname
- The name of the JORM class to be unmapped.