All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.datanucleus.store.rdbms.request.RequestIdentifier Maven / Gradle / Ivy

There is a newer version: 6.0.9
Show newest version
/**********************************************************************
Copyright (c) 2002 Kelly Grizzle (TJDO) and others. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Contributors:
2009 Andy Jefferson - removed hardcoded type, changed to use RequestType enum
    ...
**********************************************************************/
package org.datanucleus.store.rdbms.request;

import java.util.Arrays;

import org.datanucleus.metadata.AbstractMemberMetaData;
import org.datanucleus.store.rdbms.table.DatastoreClass;

/**
 * Representation of a request id.
 */
public class RequestIdentifier
{
    private final DatastoreClass table;
    private final int[] memberNumbers;
    private final RequestType type;
    private final int hashCode;
    private final String className;

    /**
     * Constructor.
     * @param table Datastore class for which this is a request
     * @param mmds MetaData of fields/properties to use in the request (if required)
     * @param type The type being represented
     * @param className The name of the class
     */
    public RequestIdentifier(DatastoreClass table, AbstractMemberMetaData[] mmds, RequestType type, 
            String className)
    {
        this.table = table;
        this.type = type;

        if (mmds == null)
        {
            this.memberNumbers = null;
        }
        else
        {
            this.memberNumbers = new int[mmds.length];
            for (int i=0;i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy