Methods Summary |
---|
public void | addAlias(java.lang.String alias, oracle.toplink.essentials.descriptors.ClassDescriptor descriptor)PUBLIC:
Add an alias for the descriptor.
if (aliasDescriptors == null) {
aliasDescriptors = new Hashtable(10);
}
aliasDescriptors.put(alias, descriptor);
|
public void | addAliasesFromProject(oracle.toplink.essentials.sessions.Project project)INTERNAL:
Get the descriptors from the project, and associate the aliases for each
descriptor with the descriptor.
Iterator descriptors = getDescriptors().values().iterator();
while (descriptors.hasNext()) {
ClassDescriptor descriptor = (ClassDescriptor)descriptors.next();
if (descriptor.getAlias() != null) {
addAlias(descriptor.getAlias(), descriptor);
}
}
|
public void | addDefaultReadOnlyClass(java.lang.Class readOnlyClass)PUBLIC:
Add the read-only class which apply to each UnitOfWork created by default.
getDefaultReadOnlyClasses().addElement(readOnlyClass);
|
public void | addDescriptor(oracle.toplink.essentials.descriptors.ClassDescriptor descriptor)PUBLIC:
Add the descriptor to the project.
getOrderedDescriptors().add(descriptor);
String alias = descriptor.getAlias();
if (alias != null) {
addAlias(alias, descriptor);
}
// Avoid loading class definition at this point if we haven't done so yet.
if ((descriptors != null) && !descriptors.isEmpty()) {
getDescriptors().put(descriptor.getJavaClass(), descriptor);
}
|
public void | addDescriptor(oracle.toplink.essentials.descriptors.ClassDescriptor descriptor, oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl session)INTERNAL: Used by the BuilderInterface when reading a Project from INI files.
getOrderedDescriptors().add(descriptor);
String alias = descriptor.getAlias();
if (alias != null) {
addAlias(alias, descriptor);
}
// Avoid loading class definition at this point if we haven't done so yet.
if ((descriptors != null) && !descriptors.isEmpty()) {
getDescriptors().put(descriptor.getJavaClass(), descriptor);
}
session.initializeDescriptorIfSessionAlive(descriptor);
|
public void | addDescriptors(java.util.Vector descriptors, oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl session)INTERNAL:
Add the descriptors to the session.
All persistent classes must have a descriptor registered for them with the session.
This method allows for a batch of descriptors to be added at once so that TopLink
can resolve the dependancies between the descriptors and perform initialization optimally.
for (Enumeration enumeration = descriptors.elements(); enumeration.hasMoreElements();) {
ClassDescriptor descriptor = (ClassDescriptor)enumeration.nextElement();
getDescriptors().put(descriptor.getJavaClass(), descriptor);
String alias = descriptor.getAlias();
if (alias != null) {
addAlias(alias, descriptor);
}
}
if (session.isConnected()) {
session.initializeDescriptors(descriptors);
// The commit order must be maintain whenever new descriptors are added.
session.getCommitManager().initializeCommitOrder();
}
getOrderedDescriptors().addAll(descriptors);
|
public void | addDescriptors(oracle.toplink.essentials.sessions.Project project, oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl session)PUBLIC:
Merge the descriptors from another project into this one.
All persistent classes must have a descriptor registered for them with the session.
This method allows for a batch of descriptors to be added at once so that TopLink
can resolve the dependancies between the descriptors and perform initialization optimially.
Iterator descriptors = project.getDescriptors().values().iterator();
while (descriptors.hasNext()) {
ClassDescriptor descriptor = (ClassDescriptor)descriptors.next();
getDescriptors().put(descriptor.getJavaClass(), descriptor);
String alias = descriptor.getAlias();
if (alias != null) {
addAlias(alias, descriptor);
}
}
if (session.isConnected()) {
session.initializeDescriptors(project.getDescriptors());
// The commit order must be maintained whenever new descriptors are added.
session.getCommitManager().initializeCommitOrder();
}
getOrderedDescriptors().addAll(project.getOrderedDescriptors());
|
public void | addSQLResultSetMapping(oracle.toplink.essentials.queryframework.SQLResultSetMapping sqlResultSetMapping)PUBLIC:
Add a named SQLResultSetMapping to this project. These SQLResultSetMappings
can be later used by ResultSetMappingQueries to map Custom sql results to
results as defined by the SQLResultSetMappings.
if (sqlResultSetMapping == null || sqlResultSetMapping.getName() == null){
return;
}
if (this.sqlResultSetMappings == null){
this.sqlResultSetMappings = new HashMap();
}
this.sqlResultSetMappings.put(sqlResultSetMapping.getName(), sqlResultSetMapping);
|
public void | applyLogin()INTERNAL:
Default apply login implementation.
Defined for generated subclasses that may not have a login.
BUG#2669342
// Do nothing by default.
|
public void | assumeExistenceForDoesExist()PUBLIC:
Switch all descriptors to assume existence for non-null primary keys.
Iterator descriptors = getDescriptors().values().iterator();
while (descriptors.hasNext()) {
ClassDescriptor descriptor = (ClassDescriptor)descriptors.next();
descriptor.getQueryManager().assumeExistenceForDoesExist();
}
|
public void | checkCacheForDoesExist()PUBLIC:
Switch all descriptors to check the cache for existence.
Iterator descriptors = getDescriptors().values().iterator();
while (descriptors.hasNext()) {
ClassDescriptor descriptor = (ClassDescriptor)descriptors.next();
descriptor.getQueryManager().checkCacheForDoesExist();
}
|
public void | checkDatabaseForDoesExist()PUBLIC:
Switch all descriptors to check the database for existence.
Iterator descriptors = getDescriptors().values().iterator();
while (descriptors.hasNext()) {
ClassDescriptor descriptor = (ClassDescriptor)descriptors.next();
descriptor.getQueryManager().checkDatabaseForDoesExist();
}
|
public java.lang.Object | clone()INTERNAL:
Clones the descriptor
try {
return super.clone();
} catch (Exception exception) {
return null;
}
|
public void | conformAllDescriptors()PUBLIC:
Set all this project's descriptors to conform all read queries within the context of the unit of work.
Iterator descriptors = getDescriptors().values().iterator();
while (descriptors.hasNext()) {
ClassDescriptor descriptor = (ClassDescriptor)descriptors.next();
descriptor.setShouldAlwaysConformResultsInUnitOfWork(true);
}
|
public void | convertClassNamesToClasses(java.lang.ClassLoader classLoader)INTERNAL:
Convert all the class-name-based settings in this project to actual class-based
settings
Iterator ordered = orderedDescriptors.iterator();
while (ordered.hasNext()){
ClassDescriptor descriptor = (ClassDescriptor)ordered.next();
descriptor.convertClassNamesToClasses(classLoader);
}
// convert class names to classes for each SQLResultSetMapping
if (sqlResultSetMappings != null) {
for (Iterator mappingIt = sqlResultSetMappings.keySet().iterator(); mappingIt.hasNext();) {
SQLResultSetMapping mapping = (SQLResultSetMapping) sqlResultSetMappings.get(mappingIt.next());
mapping.convertClassNamesToClasses(classLoader);
}
}
|
public oracle.toplink.essentials.sessions.DatabaseSession | createDatabaseSession()PUBLIC:
Factory method to create session.
This returns an implementor of the DatabaseSession interface, which can be used to login
and add descriptors from other projects. The Session interface however should be used for
reading and writing once connected for complete portability.
return new DatabaseSessionImpl(this);
|
public oracle.toplink.essentials.threetier.Server | createServerSession()PUBLIC:
Factory method to create a server session.
This returns an implementor of the Server interface, which can be used to login
and add descriptors from other projects, configure connection pooling and acquire client sessions.
return new ServerSession(this);
|
public oracle.toplink.essentials.threetier.Server | createServerSession(int min, int max)PUBLIC:
Factory method to create a server session.
This returns an implementor of the Server interface, which can be used to login
and add descriptors from other projects, configure connection pooling and acquire client sessions.
Configure the min and max number of connections for the default pool.
return new ServerSession(this, min, max);
|
public oracle.toplink.essentials.threetier.Server | createServerSession(oracle.toplink.essentials.threetier.ConnectionPolicy defaultConnectionPolicy)PUBLIC:
Factory method to create a server session.
This returns an implementor of the Server interface, which can be used to login
and add descriptors from other projects, configure connection pooling and acquire client sessions.
Configure the default connection policy to be used.
This policy is used on the "acquireClientSession()" protocol.
return new ServerSession(this, defaultConnectionPolicy);
|
public java.util.Map | getAliasDescriptors()INTERNAL:
Returns the alias descriptors hashtable.
return aliasDescriptors;
|
public oracle.toplink.essentials.descriptors.ClassDescriptor | getClassDescriptor(java.lang.Class theClass)PUBLIC:
Return the descriptor specified for the class.
ClassDescriptor desc = getDescriptor(theClass);
if (desc instanceof ClassDescriptor) {
return (ClassDescriptor)desc;
} else {
throw ValidationException.cannotCastToClass(desc, desc.getClass(), ClassDescriptor.class);
}
|
public oracle.toplink.essentials.descriptors.ClassDescriptor | getClassDescriptorForAlias(java.lang.String alias)PUBLIC:
Return the descriptor for the alias.
ClassDescriptor d = null;
if (aliasDescriptors != null) {
d = (ClassDescriptor)aliasDescriptors.get(alias);
}
return d;
|
public oracle.toplink.essentials.sessions.Login | getDatasourceLogin()PUBLIC:
Return the login, the login holds any database connection information given.
This return the Login interface and may need to be cast to the datasource specific implementation.
return datasourceLogin;
|
public java.util.Vector | getDefaultReadOnlyClasses()PUBLIC:
Returns the default set of read-only classes.
return defaultReadOnlyClasses;
|
public oracle.toplink.essentials.descriptors.ClassDescriptor | getDescriptor(java.lang.Class theClass)PUBLIC:
Return the descriptor specified for the class.
return (ClassDescriptor)getDescriptors().get(theClass);
|
public oracle.toplink.essentials.descriptors.ClassDescriptor | getDescriptorForAlias(java.lang.String alias)PUBLIC:
Return the descriptor for the alias.
ClassDescriptor d = null;
if (aliasDescriptors != null) {
d = (ClassDescriptor)aliasDescriptors.get(alias);
}
return d;
|
public java.util.Map | getDescriptors()PUBLIC:
Return the descriptors.
// Lazy initialize class references from orderedDescriptors when reading from XML.
if (descriptors.isEmpty() && (!orderedDescriptors.isEmpty())) {
for (Iterator iterator = orderedDescriptors.iterator(); iterator.hasNext();) {
ClassDescriptor descriptor = (ClassDescriptor)iterator.next();
descriptors.put(descriptor.getJavaClass(), descriptor);
}
}
return descriptors;
|
public oracle.toplink.essentials.sessions.DatabaseLogin | getLogin()INTERNAL:
Return the login, the login holds any database connection information given.
This has been replaced by getDatasourceLogin to make use of the Login interface
to support non-relational datasources,
if DatabaseLogin API is required it will need to be cast.
return (DatabaseLogin)datasourceLogin;
|
public java.lang.String | getName()PUBLIC:
get the name of the project.
return name;
|
public java.util.Vector | getOrderedDescriptors()INTERNAL:
Return the descriptors in the order added.
Used to maitain consistent order in XML.
return orderedDescriptors;
|
public oracle.toplink.essentials.queryframework.SQLResultSetMapping | getSQLResultSetMapping(java.lang.String sqlResultSetMapping)PUBLIC:
Get a named SQLResultSetMapping from this project. These SQLResultSetMappings
can be used by ResultSetMappingQueries to map Custom sql results to
results as defined by the SQLResultSetMappings.
if (sqlResultSetMapping == null || this.sqlResultSetMappings == null){
return null;
}
return (SQLResultSetMapping)this.sqlResultSetMappings.get(sqlResultSetMapping);
|
public boolean | hasGenericHistorySupport()INTERNAL:
Answers if at least one Descriptor or Mapping had a HistoryPolicy at initialize time.
return hasGenericHistorySupport;
|
public boolean | hasIsolatedClasses()INTERNAL:
Return if any descriptors are isolated.
Set to true during descriptor initialize if any descriptor is isolated.
Determines if an isolated client session is required.
return hasIsolatedClasses;
|
public boolean | hasProxyIndirection()INTERNAL:
Return if any descriptors use ProxyIndirection.
Set to true during descriptor initialize if any descriptor uses ProxyIndirection
Determines if ProxyIndirectionPolicy.getValueFromProxy should be called.
return this.hasProxyIndirection;
|
public boolean | isPureCMP2Project()INTERNAL:
Return if all descriptors are for CMP1 or CMP2 beans.
Set to true during descriptor initialize.
Allows certain optimizations to be made.
return isPureCMP2Project;
|
public void | setAliasDescriptors(java.util.Map aHashtable)INTERNAL:
Set the alias descriptors hashtable.
aliasDescriptors = aHashtable;
|
public void | setDatasourceLogin(oracle.toplink.essentials.sessions.Login datasourceLogin)PUBLIC:
Set the login to be used to connect to the database for this project.
this.datasourceLogin = datasourceLogin;
|
public void | setDefaultReadOnlyClasses(java.util.Vector newValue)PUBLIC:
Set the read-only classes which apply to each UnitOfWork create by default.
this.defaultReadOnlyClasses = (Vector)newValue.clone();
|
public void | setDescriptors(java.util.Map descriptors)INTERNAL:
Set the descriptors registered with this session.
this.descriptors = descriptors;
for (Iterator iterator = descriptors.values().iterator(); iterator.hasNext();) {
ClassDescriptor descriptor = (ClassDescriptor)iterator.next();
String alias = descriptor.getAlias();
if (alias != null) {
addAlias(alias, descriptor);
}
}
|
public void | setHasGenericHistorySupport(boolean hasGenericHistorySupport)INTERNAL:
Set to true during descriptor initialize if any descriptor has hsitory.
this.hasGenericHistorySupport = hasGenericHistorySupport;
|
public void | setHasIsolatedClasses(boolean hasIsolatedClasses)INTERNAL:
Set to true during descriptor initialize if any descriptor is isolated.
Determines if an isolated client session is required.
this.hasIsolatedClasses = hasIsolatedClasses;
|
public void | setHasProxyIndirection(boolean hasProxyIndirection)INTERNAL:
Set to true during descriptor initialize if any descriptor uses ProxyIndirection
Determines if ProxyIndirectionPolicy.getValueFromProxy should be called.
this.hasProxyIndirection = hasProxyIndirection;
|
public void | setIsPureCMP2Project(boolean isPureCMP2Project)INTERNAL:
Set if all descriptors are for CMP1 or CMP2 beans.
Set to true during descriptor initialize.
Allows certain optimizations to be made.
this.isPureCMP2Project = isPureCMP2Project;
|
public void | setLogin(oracle.toplink.essentials.sessions.DatabaseLogin datasourceLogin)PUBLIC:
Set the login to be used to connect to the database for this project.
this.datasourceLogin = datasourceLogin;
|
public void | setLogin(oracle.toplink.essentials.sessions.Login datasourceLogin)PUBLIC:
Set the login to be used to connect to the database for this project.
this.datasourceLogin = datasourceLogin;
|
public void | setName(java.lang.String name)PUBLIC:
Set the name of the project.
this.name = name;
|
public void | setOrderedDescriptors(java.util.Vector orderedDescriptors)INTERNAL:
Set the descriptors order.
Used to maitain consistent order in XML.
this.orderedDescriptors = orderedDescriptors;
for (Enumeration e = orderedDescriptors.elements(); e.hasMoreElements();) {
ClassDescriptor descriptor = (ClassDescriptor)e.nextElement();
String alias = descriptor.getAlias();
if (alias != null) {
addAlias(alias, descriptor);
}
}
|
public java.lang.String | toString()INTERNAL:
return Helper.getShortClassName(getClass()) + "(" + getName() + ")";
|
public void | useCacheIdentityMap()PUBLIC:
Switch all descriptors to use the cache identity map.
Iterator descriptors = getDescriptors().values().iterator();
while (descriptors.hasNext()) {
ClassDescriptor descriptor = (ClassDescriptor)descriptors.next();
descriptor.useCacheIdentityMap();
}
|
public void | useCacheIdentityMap(int cacheSize)PUBLIC:
Switch all descriptors to use the cache identity map the size.
Iterator descriptors = getDescriptors().values().iterator();
while (descriptors.hasNext()) {
ClassDescriptor descriptor = (ClassDescriptor)descriptors.next();
descriptor.useCacheIdentityMap();
descriptor.setIdentityMapSize(cacheSize);
}
|
public void | useFullIdentityMap()PUBLIC:
Switch all descriptors to use the full identity map.
Iterator descriptors = getDescriptors().values().iterator();
while (descriptors.hasNext()) {
ClassDescriptor descriptor = (ClassDescriptor)descriptors.next();
descriptor.useFullIdentityMap();
}
|
public void | useFullIdentityMap(int initialCacheSize)PUBLIC:
Switch all descriptors to use the full identity map with initial cache size.
Iterator descriptors = getDescriptors().values().iterator();
while (descriptors.hasNext()) {
ClassDescriptor descriptor = (ClassDescriptor)descriptors.next();
descriptor.useFullIdentityMap();
descriptor.setIdentityMapSize(initialCacheSize);
}
|
public void | useNoIdentityMap()PUBLIC:
Switch all descriptors to use no identity map.
Iterator descriptors = getDescriptors().values().iterator();
while (descriptors.hasNext()) {
ClassDescriptor descriptor = (ClassDescriptor)descriptors.next();
descriptor.useNoIdentityMap();
}
|
public void | useSoftCacheWeakIdentityMap()PUBLIC:
Switch all descriptors to use the soft cache weak identity map.
Iterator descriptors = getDescriptors().values().iterator();
while (descriptors.hasNext()) {
ClassDescriptor descriptor = (ClassDescriptor)descriptors.next();
descriptor.useSoftCacheWeakIdentityMap();
}
|
public void | useSoftCacheWeakIdentityMap(int cacheSize)PUBLIC:
Switch all descriptors to use the soft cache weak identity map with soft cache size.
Iterator descriptors = getDescriptors().values().iterator();
while (descriptors.hasNext()) {
ClassDescriptor descriptor = (ClassDescriptor)descriptors.next();
descriptor.useSoftCacheWeakIdentityMap();
descriptor.setIdentityMapSize(cacheSize);
}
|
public void | useWeakIdentityMap()PUBLIC:
Switch all descriptors to use the weak identity map.
Iterator descriptors = getDescriptors().values().iterator();
while (descriptors.hasNext()) {
ClassDescriptor descriptor = (ClassDescriptor)descriptors.next();
descriptor.useWeakIdentityMap();
}
|
public void | useWeakIdentityMap(int initialCacheSize)PUBLIC:
Switch all descriptors to use the weak identity map.
Iterator descriptors = getDescriptors().values().iterator();
while (descriptors.hasNext()) {
ClassDescriptor descriptor = (ClassDescriptor)descriptors.next();
descriptor.useWeakIdentityMap();
descriptor.setIdentityMapSize(initialCacheSize);
}
|
public boolean | usesOptimisticLocking()INTERNAL:
Asks each descriptor if is uses optimistic locking.
Iterator descriptors = getDescriptors().values().iterator();
while (descriptors.hasNext()) {
ClassDescriptor descriptor = (ClassDescriptor)descriptors.next();
if (descriptor.usesOptimisticLocking()) {
return true;
}
}
return false;
|
public boolean | usesSequencing()INTERNAL:
Asks each descriptor if is uses sequencing.
Iterator descriptors = getDescriptors().values().iterator();
while (descriptors.hasNext()) {
ClassDescriptor descriptor = (ClassDescriptor)descriptors.next();
if (descriptor.usesSequenceNumbers()) {
return true;
}
}
return false;
|