public class ClassDesc extends Object implements PersistenceConfig
| Modifier and Type | Field and Description |
|---|---|
ArrayList |
fields
Contains all local and foreign fields.
|
ArrayList |
foreignFields
Contains all relationship fields.
|
ArrayList |
hiddenFields
Contains all hidden fields.
|
int |
maxFields |
int |
maxHiddenFields |
int |
maxVisibleFields |
| Constructor and Description |
|---|
ClassDesc(MappingClassElement mdConfig,
Class pcClass) |
| Modifier and Type | Method and Description |
|---|---|
TableDesc |
findTableDesc(org.netbeans.modules.dbschema.TableElement mdTable) |
Concurrency |
getConcurrency(boolean optimistic) |
Constructor |
getConstructor() |
ArrayList |
getFetchGroup(int groupID)
Returns a list of fields in fetchGroup
groupID. |
FieldDesc |
getField(int index) |
FieldDesc |
getField(String name) |
LocalFieldDesc[] |
getKeyFieldDescs()
Returns the descriptors for key fields as array of LocalFieldDesc.
|
String[] |
getKeyFieldNames()
Returns the key field names as array of String.
|
Field[] |
getKeyFields()
Return the key fields as array of java.lang.reflect.Field instances.
|
LocalFieldDesc |
getLocalFieldDesc(String name)
Returns the local field descriptor for the field
name. |
String |
getName() |
Class |
getOidClass() |
Class |
getPersistenceCapableClass() |
TableDesc |
getPrimaryTable() |
RetrieveDesc |
getRetrieveDescForFKQuery(ForeignFieldDesc foreignField,
PersistenceStore store)
Returns a RetrieveDescriptor which represent a SQL query selecting pc
instances by the relationship key.
|
RetrieveDesc |
getRetrieveDescForPKQuery(FieldDesc additionalField,
PersistenceStore store)
Returns a RetrieveDescriptor which represent a SQL query selecting a pc
instance by pk-fields.
|
RetrieveDesc |
getRetrieveDescForVerificationQuery(PersistenceStore store)
Gets RetrieveDescriptor(rd) for verifying a VC instance.
|
int |
getTableIndex(TableDesc tableDesc) |
Iterator |
getTables() |
UpdateQueryPlan |
getUpdateQueryPlan(UpdateObjectDescImpl desc,
SQLStoreManager store)
Retrieves the update query plan for the specified descriptor.
|
LocalFieldDesc[] |
getVersionFields() |
boolean |
hasLocalNonDFGFields()
Returns true, if this class has got local fields not in the default
fetch group.
|
boolean |
hasModifiedCheckAtCommitConsistency()
Determines whether this classDesc has the
CHECK_MODIFIED_AT_COMMIT_CONSISTENCY level.
|
boolean |
hasVersionConsistency() |
void |
initialize(ConfigCache cache) |
boolean |
isNavigable() |
boolean |
isPKField(int index) |
SQLStateManager |
newStateManagerInstance(PersistenceStore store)
Returns a new
SQLStateManager instance,
initialized with passed store manager and this instance of
the runtime class model. |
String |
toString() |
public ArrayList fields
public ArrayList hiddenFields
public ArrayList foreignFields
public int maxFields
public int maxVisibleFields
public int maxHiddenFields
public ClassDesc(MappingClassElement mdConfig, Class pcClass)
public void initialize(ConfigCache cache)
public ArrayList getFetchGroup(int groupID)
groupID.groupID - Fetch group id.groupID. The list
for FieldDesc.GROUP_NONE is empty.initializeFetchGroups()public LocalFieldDesc getLocalFieldDesc(String name)
name.name - Field name.name.JDOFatalInternalException - if the field is not defined for this class.public TableDesc findTableDesc(org.netbeans.modules.dbschema.TableElement mdTable)
public int getTableIndex(TableDesc tableDesc)
public FieldDesc getField(int index)
public Constructor getConstructor()
getConstructor in interface PersistenceConfigpublic Class getPersistenceCapableClass()
getPersistenceCapableClass in interface PersistenceConfigpublic Class getOidClass()
getOidClass in interface PersistenceConfigpublic String getName()
public Iterator getTables()
public TableDesc getPrimaryTable()
public boolean isNavigable()
public boolean hasVersionConsistency()
hasVersionConsistency in interface PersistenceConfigpublic LocalFieldDesc[] getVersionFields()
public Concurrency getConcurrency(boolean optimistic)
public boolean hasModifiedCheckAtCommitConsistency()
true if this has the
CHECK_MODIFIED_AT_COMMIT_CONSISTENCY level;
false otherwise.public boolean isPKField(int index)
public Field[] getKeyFields()
getKeyFields in interface PersistenceConfigpublic String[] getKeyFieldNames()
getKeyFieldNames in interface PersistenceConfigpublic LocalFieldDesc[] getKeyFieldDescs()
public SQLStateManager newStateManagerInstance(PersistenceStore store)
SQLStateManager instance,
initialized with passed store manager and this instance of
the runtime class model.store - Store manager, an instance of SQLStoreManager.SQLStateManager instance.public RetrieveDesc getRetrieveDescForPKQuery(FieldDesc additionalField, PersistenceStore store)
additionalField - The field to be retrieved in addition to the
DFG fields.store - The store manager.getRetrieveDescForFKQuery(com.sun.jdo.spi.persistence.support.sqlstore.model.ForeignFieldDesc, com.sun.jdo.spi.persistence.support.sqlstore.PersistenceStore)public RetrieveDesc getRetrieveDescForFKQuery(ForeignFieldDesc foreignField, PersistenceStore store)
foreignField and used as query constraint.
Please note that the RDs are cached, so the method first checks the cache.
If there is no corresponding RetrieveDescriptor in the cache, it creates
a new one and stores it in the cache. FetchGroup fields will be added
when the query plan is build, see SelectQueryPlan#processFetchGroups.
Note, the reason to introduce the RetrieveDesc cache in ClassDesc and not
in the store manager is, that we can have the cache per class, where
the store manager could only provide one big cache for all pc classes.foreignField - The relationship field to be retrieved.
Following is true for this field.
Or
Not part of any fetch group.
store - The store manager.getRetrieveDescForPKQuery(com.sun.jdo.spi.persistence.support.sqlstore.model.FieldDesc, com.sun.jdo.spi.persistence.support.sqlstore.PersistenceStore)public RetrieveDesc getRetrieveDescForVerificationQuery(PersistenceStore store)
store - public boolean hasLocalNonDFGFields()
getUpdateQueryPlanForUpdate(com.sun.jdo.spi.persistence.support.sqlstore.sql.UpdateObjectDescImpl, com.sun.jdo.spi.persistence.support.sqlstore.SQLStoreManager), we
might need to compare the updated fields btw. two instances when
batching is enabled.hasLocalNonDFGFields in interface PersistenceConfigSQLStateManager.requiresImmediateFlush(com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager)public UpdateQueryPlan getUpdateQueryPlan(UpdateObjectDescImpl desc, SQLStoreManager store)
desc - the descriptorstore - the store managerCopyright © 2017. All rights reserved.