Class ClassDesc

    • Field Detail

      • fields

        public ArrayList fields
        Contains all local and foreign fields.
      • hiddenFields

        public ArrayList hiddenFields
        Contains all hidden fields.
      • foreignFields

        public ArrayList foreignFields
        Contains all relationship fields.
      • maxFields

        public int maxFields
      • maxVisibleFields

        public int maxVisibleFields
      • maxHiddenFields

        public int maxHiddenFields
    • Method Detail

      • initialize

        public void initialize​(ConfigCache cache)
      • getFetchGroup

        public ArrayList getFetchGroup​(int groupID)
        Returns a list of fields in fetchGroup groupID.
        Parameters:
        groupID - Fetch group id.
        Returns:
        List of fields in fetchGroup groupID. The list for FieldDesc.GROUP_NONE is empty.
        See Also:
        initializeFetchGroups()
      • getLocalFieldDesc

        public LocalFieldDesc getLocalFieldDesc​(String name)
        Returns the local field descriptor for the field name.
        Parameters:
        name - Field name.
        Returns:
        Local field descriptor for the field name.
        Throws:
        JDOFatalInternalException - if the field is not defined for this class.
      • findTableDesc

        public TableDesc findTableDesc​(org.netbeans.modules.dbschema.TableElement mdTable)
      • getTableIndex

        public int getTableIndex​(TableDesc tableDesc)
      • getField

        public FieldDesc getField​(int index)
      • getName

        public String getName()
      • getTables

        public Iterator getTables()
      • getPrimaryTable

        public TableDesc getPrimaryTable()
      • isNavigable

        public boolean isNavigable()
      • getConcurrency

        public Concurrency getConcurrency​(boolean optimistic)
      • hasModifiedCheckAtCommitConsistency

        public boolean hasModifiedCheckAtCommitConsistency()
        Determines whether this classDesc has the CHECK_MODIFIED_AT_COMMIT_CONSISTENCY level.
        Returns:
        true if this has the CHECK_MODIFIED_AT_COMMIT_CONSISTENCY level; false otherwise.
      • isPKField

        public boolean isPKField​(int index)
      • getKeyFields

        public Field[] getKeyFields()
        Return the key fields as array of java.lang.reflect.Field instances.
        Specified by:
        getKeyFields in interface PersistenceConfig
        Returns:
        The key fields as array of java.lang.reflect.Field instances.
      • getKeyFieldNames

        public String[] getKeyFieldNames()
        Returns the key field names as array of String.
        Specified by:
        getKeyFieldNames in interface PersistenceConfig
        Returns:
        The key field names as array of String.
      • getKeyFieldDescs

        public LocalFieldDesc[] getKeyFieldDescs()
        Returns the descriptors for key fields as array of LocalFieldDesc.
        Returns:
        The descriptors for key fields as array of LocalFieldDesc.
      • newStateManagerInstance

        public SQLStateManager newStateManagerInstance​(PersistenceStore store)
        Returns a new SQLStateManager instance, initialized with passed store manager and this instance of the runtime class model.
        Parameters:
        store - Store manager, an instance of SQLStoreManager.
        Returns:
        A new SQLStateManager instance.
      • getRetrieveDescForPKQuery

        public RetrieveDesc getRetrieveDescForPKQuery​(FieldDesc additionalField,
                                                      PersistenceStore store)
        Returns a RetrieveDescriptor which represent a SQL query selecting a pc instance by pk-fields. 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. If the additionalField is not null, the method retrieves the field indicated by it along with the query. Fetch group fields will be added when the query plan is build. 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.
        Parameters:
        additionalField - The field to be retrieved in addition to the DFG fields.
        store - The store manager.
        Returns:
        A RetrieveDescriptor selecting a pc instance by pk-fields.
        See Also:
        getRetrieveDescForFKQuery(com.sun.jdo.spi.persistence.support.sqlstore.model.ForeignFieldDesc, com.sun.jdo.spi.persistence.support.sqlstore.PersistenceStore)
      • getRetrieveDescForFKQuery

        public RetrieveDesc getRetrieveDescForFKQuery​(ForeignFieldDesc foreignField,
                                                      PersistenceStore store)
        Returns a RetrieveDescriptor which represent a SQL query selecting pc instances by the relationship key. The relationship key is taken from the foreign field 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.
        Parameters:
        foreignField - The relationship field to be retrieved. Following is true for this field.
        • It is part of an independent fetch group with only one field in the fetch group.

          Or

          Not part of any fetch group.

        • It is not mapped to a join table.
        store - The store manager.
        Returns:
        A RetrieveDescriptor selecting pc instance(s) corresponding to the foreign field
        See Also:
        getRetrieveDescForPKQuery(com.sun.jdo.spi.persistence.support.sqlstore.model.FieldDesc, com.sun.jdo.spi.persistence.support.sqlstore.PersistenceStore)
      • getRetrieveDescForVerificationQuery

        public RetrieveDesc getRetrieveDescForVerificationQuery​(PersistenceStore store)
        Gets RetrieveDescriptor(rd) for verifying a VC instance. The returned rd is set up to expect constraints for pk followed by constraints for version fields.
        Parameters:
        store -
        Returns:
        Instance of retrieve Descriptor for verifying a VC instance.
      • getUpdateQueryPlan

        public UpdateQueryPlan getUpdateQueryPlan​(UpdateObjectDescImpl desc,
                                                  SQLStoreManager store)
        Retrieves the update query plan for the specified descriptor.
        Parameters:
        desc - the descriptor
        store - the store manager
        Returns:
        Instance of update query plan for the specified descriptor.