Package org.jpox.store.mapped

Examples of org.jpox.store.mapped.DatastoreIdentifier


     * @return The index datastore field identifier
     */
    public DatastoreIdentifier newIndexFieldIdentifier()
    {
        String name = "INTEGER_IDX";
        DatastoreIdentifier identifier = (DatastoreIdentifier) columns.get(name);
        if (identifier == null)
        {
            identifier = new ColumnIdentifier(this, name);
            columns.put(name, identifier);
        }
View Full Code Here


            synchronized (this)
            {
                long now = System.currentTimeMillis();

                // Get fully-qualified name for this table (regardless of whether it is specified by user)
                DatastoreIdentifier tableId = ((AbstractTable)table).getDatastoreIdentifierFullyQualified();
                List cols = null;
                // Check if we already have valid info for this table in the cache
                if (now >= columnInfoReadTimestamp &&
                    now < columnInfoReadTimestamp + COLUMN_INFO_EXPIRATION_MS)
                {
                    cols = (List) columnInfoByColumnName.get(tableId.getIdentifier()+column.getIdentifier());
                    if (cols != null)
                    {
                        for(int i=0; i<cols.size(); i++)
                        {
                            String[] c = RDBMSStoreHelper.splitColumnIdentifierName(((RDBMSAdapter)this.getDatastoreAdapter()).getCatalogSeparator(), column.getIdentifier());
                            String columnName = column.getIdentifier();
                            if (c[RDBMSStoreHelper.TABLE_IDENTIFIER_COLUMN] != null)
                            {
                                columnName = c[RDBMSStoreHelper.TABLE_IDENTIFIER_COLUMN];
                            }                           
                            ColumnInfo ci = (ColumnInfo) cols.get(i);
                            if (ci.getColumnName().equals(columnName))
                            {
                                colInfo = ci;
                            }
                        }
                    }
                }

                // Refresh the cache if we have no/stale info for that table
                if (cols == null)
                {
                    //TODO have a cache of columnInfo by column name
                    colInfo = RDBMSStoreHelper.getColumnInfoForColumnName(this, table, conn, column);
                    if (colInfo == null)
                    {
                        JPOXLogger.DATASTORE_SCHEMA.info(LOCALISER_RDBMS.msg("050031", column.getIdentifier(), table));
                    }
                    else
                    {
                        columnInfoByColumnName.put(tableId.getIdentifier()+column.getIdentifier(), colInfo);
                        if (JPOXLogger.DATASTORE_SCHEMA.isDebugEnabled())
                        {
                            JPOXLogger.DATASTORE_SCHEMA.debug(LOCALISER_RDBMS.msg("050033", colInfo.getColumnName(), table));
                        }
                    }
View Full Code Here

            synchronized (this)
            {
                long now = System.currentTimeMillis();

                // Get fully-qualified name for this table (regardless of whether it is specified by user)
                DatastoreIdentifier tableId = ((AbstractTable)table).getDatastoreIdentifierFullyQualified();

                // Check if we already have valid info for this table in the cache
                if (now >= columnInfoReadTimestamp &&
                    now < columnInfoReadTimestamp + COLUMN_INFO_EXPIRATION_MS)
                {
View Full Code Here

     * @return The DatastoreIdentifier
     */
    public DatastoreIdentifier newReferenceFieldIdentifier(AbstractMemberMetaData refMetaData,
            AbstractClassMetaData implMetaData, DatastoreIdentifier implIdentifier, boolean embedded, int fieldRole)
    {
        DatastoreIdentifier identifier = null;
        String key = "[" + refMetaData.getFullFieldName() + "][" + implMetaData.getFullClassName() + "][" + implIdentifier.getIdentifier() + "]";
        identifier = (DatastoreIdentifier) references.get(key);
        if (identifier == null)
        {
            // use a simple naming for now : <reference-name>_<impl_name>_<impl_type>
View Full Code Here

     * @return The identifier.
     */
    public DatastoreIdentifier newJoinTableFieldIdentifier(AbstractMemberMetaData ownerFmd, AbstractMemberMetaData relatedFmd,
            DatastoreIdentifier destinationId, boolean embedded, int fieldRole)
    {
        DatastoreIdentifier identifier = null;

        if (relatedFmd != null)
        {
            // Bidirectional
            if (fieldRole == FieldRole.ROLE_OWNER)
View Full Code Here

     * @return The discriminator column identifier
     */
    public DatastoreIdentifier newDiscriminatorFieldIdentifier()
    {
        String name = "DTYPE"; // JPA1 spec [9.1.30] discriminator column defaults to "DTYPE"
        DatastoreIdentifier identifier = (DatastoreIdentifier) columns.get(name);
        if (identifier == null)
        {
            identifier = new ColumnIdentifier(this, name);
            columns.put(name, identifier);
        }
View Full Code Here

     * @return The version datastore field identifier
     */
    public DatastoreIdentifier newVersionFieldIdentifier()
    {
        String name = "VERSION";
        DatastoreIdentifier identifier = (DatastoreIdentifier) columns.get(name);
        if (identifier == null)
        {
            identifier = new ColumnIdentifier(this, name);
            columns.put(name, identifier);
        }
View Full Code Here

     * @return The index datastore field identifier
     */
    public DatastoreIdentifier newIndexFieldIdentifier()
    {
        String name = "IDX";
        DatastoreIdentifier identifier = (DatastoreIdentifier) columns.get(name);
        if (identifier == null)
        {
            identifier = new ColumnIdentifier(this, name);
            columns.put(name, identifier);
        }
View Full Code Here

     * @return The index datastore field identifier
     */
    public DatastoreIdentifier newAdapterIndexFieldIdentifier()
    {
        String name = "IDX"; // All index fields are called IDX in this factory
        DatastoreIdentifier identifier = (DatastoreIdentifier) columns.get(name);
        if (identifier == null)
        {
            identifier = new ColumnIdentifier(this, name);
            columns.put(name, identifier);
        }
View Full Code Here

     * @return The version datastore field identifier
     */
    public DatastoreIdentifier newVersionFieldIdentifier()
    {
        String name = "VERSION";
        DatastoreIdentifier identifier = (DatastoreIdentifier) columns.get(name);
        if (identifier == null)
        {
            identifier = new ColumnIdentifier(this, name);
            columns.put(name, identifier);
        }
View Full Code Here

TOP

Related Classes of org.jpox.store.mapped.DatastoreIdentifier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.