org.objectweb.speedo.mim.api
Interface SpeedoHome

All Known Implementing Classes:
SpeedoHomeImpl

public interface SpeedoHome

It defines a home for a persitent class. The home groups common fields and methods.

Author:
S.Chassande-Barrioz

Method Summary
 QueryDefinition addNamedQuery(java.lang.String name, QueryDefinition query)
          Defines a named query
 void attachCopy(SpeedoProxy sp, ProxyManager pm, java.util.Map map, java.lang.Object clone, SpeedoAccessor sa, boolean makeTransactional)
           
 SpeedoProxy detachCopy(SpeedoProxy sp, ProxyManager pm, java.util.Map map, java.lang.Object clone, java.util.Collection fgHints)
           
 java.util.Collection fgGetFieldsToLoad(java.lang.String fgName)
           
 java.util.Collection fgGetFieldsToLoad(java.lang.String fgName, boolean onlyDirectRef)
           
 java.util.Collection fgGetNestedFetchGroups(java.lang.String fgName)
           
 boolean fgIsDefined(java.lang.String fgName)
           
 java.util.Properties getClassProperties()
           
 QueryDefinition getNamedQuery(java.lang.String name)
          Retrieves a query defintion from its name.
 java.lang.String getProjectName()
           
 ProxyManagerFactory getProxyManagerFactory()
           
 SpeedoAccessor getSpeedoAccessor(SpeedoProxy sp)
           
 TransactionalPersistenceManager getTransactionalPersistenceManager()
           
 byte getVersioningStrategy()
          The versioning strategy.
 void initSH()
           
 boolean isCacheable()
          Indicates if the state of persistent instance managed by this home, are kept between two transaction.
 boolean isDetachable()
          Indicates if the class has been marked as detacheable
 SpeedoAccessor readIntention(SpeedoProxy sp, long[] fields)
          Notifies the transactional persistency manager of a read intention for the given persistent instance.
 QueryDefinition removeNamedQuery(java.lang.String name)
          Remove a named query
 void setCacheable(boolean v)
          Permit to Indicate if the state of persistent instance managed by this home, are kept between two transaction.
 void setProxyManagerFactory(ProxyManagerFactory _pmf)
          It assignes a PersistenceManagerFactory
 void setTransactionalPersistenceManager(TransactionalPersistenceManager _tpm)
          It assignes a TransactionalPersistenceManager
 SpeedoAccessor writeIntention(SpeedoProxy sp, long[] fields)
          Notifies the transactional persistency manager of a write intention for the given persistent instance.
 

Method Detail

getProjectName

public java.lang.String getProjectName()

isDetachable

public boolean isDetachable()
Indicates if the class has been marked as detacheable

Returns:

isCacheable

public boolean isCacheable()
Indicates if the state of persistent instance managed by this home, are kept between two transaction.

Returns:
true means the state is kept between transaction.

setCacheable

public void setCacheable(boolean v)
Permit to Indicate if the state of persistent instance managed by this home, are kept between two transaction.


getVersioningStrategy

public byte getVersioningStrategy()
The versioning strategy.

See Also:
STATE_COMPARISON VERSION_NUMBER NO_VERSION

getProxyManagerFactory

public ProxyManagerFactory getProxyManagerFactory()
Returns:
the PersistenceManagerFactory representing the data support where the proxy is persistent.

setProxyManagerFactory

public void setProxyManagerFactory(ProxyManagerFactory _pmf)
It assignes a PersistenceManagerFactory

Parameters:
_pmf - is the PersistenceManagerFactory representing the data support where the proxy is persistent.

getTransactionalPersistenceManager

public TransactionalPersistenceManager getTransactionalPersistenceManager()
Returns:
the TransactionalPersistenceManager which manages the concurrency, loading, caching ... of the proxies.

setTransactionalPersistenceManager

public void setTransactionalPersistenceManager(TransactionalPersistenceManager _tpm)
It assignes a TransactionalPersistenceManager

Parameters:
_tpm - is the TransactionalPersistenceManager which manage the concurrency, loading, ... of the proxy.

readIntention

public SpeedoAccessor readIntention(SpeedoProxy sp,
                                    long[] fields)
Notifies the transactional persistency manager of a read intention for the given persistent instance.

Parameters:
sp - is the SpeedoProxy which the read access is requested.
fields - the ids of the fields that may be accessed by the caller of this method. If the i-th bit of 'fields' is set to 1, then the i-th field of the given speedo accessor may be accessed by the caller of this method.

writeIntention

public SpeedoAccessor writeIntention(SpeedoProxy sp,
                                     long[] fields)
Notifies the transactional persistency manager of a write intention for the given persistent instance.

Parameters:
sp - is the SpeedoProxy which the write access is requested.
fields - the ids of the fields that may be accessed by the caller of this method. If the i-th bit of 'fields' is set to 1, then the i-th field of the given speedo accessor may be accessed by the caller of this method.

getSpeedoAccessor

public SpeedoAccessor getSpeedoAccessor(SpeedoProxy sp)

detachCopy

public SpeedoProxy detachCopy(SpeedoProxy sp,
                              ProxyManager pm,
                              java.util.Map map,
                              java.lang.Object clone,
                              java.util.Collection fgHints)

attachCopy

public void attachCopy(SpeedoProxy sp,
                       ProxyManager pm,
                       java.util.Map map,
                       java.lang.Object clone,
                       SpeedoAccessor sa,
                       boolean makeTransactional)

fgGetNestedFetchGroups

public java.util.Collection fgGetNestedFetchGroups(java.lang.String fgName)

fgIsDefined

public boolean fgIsDefined(java.lang.String fgName)
Parameters:
fgName - is a fetch group name
Returns:
true is the fetch group is defined, otherwise false.

fgGetFieldsToLoad

public java.util.Collection fgGetFieldsToLoad(java.lang.String fgName)

fgGetFieldsToLoad

public java.util.Collection fgGetFieldsToLoad(java.lang.String fgName,
                                              boolean onlyDirectRef)

getClassProperties

public java.util.Properties getClassProperties()

addNamedQuery

public QueryDefinition addNamedQuery(java.lang.String name,
                                     QueryDefinition query)
Defines a named query

Parameters:
name - is the name identifying the query
query - is the definition of the query
Returns:
the old query definition corresponding to the name, if it existed one.

removeNamedQuery

public QueryDefinition removeNamedQuery(java.lang.String name)
Remove a named query

Parameters:
name - is the name of the query definition to remove
Returns:
the removed query definition (null if not found)

getNamedQuery

public QueryDefinition getNamedQuery(java.lang.String name)
Retrieves a query defintion from its name. If the name is not known, the null value is returned.

Parameters:
name - is the name the wanted query definition

initSH

public void initSH()