Package org.datanucleus.store

Examples of org.datanucleus.store.StoreData


                ResultSet rs = sqlControl.executeStatementQuery(conn, fetchAllStmt, ps);
                try
                {
                    while (rs.next())
                    {
                        StoreData data = new MappedStoreData(rs.getString(1), rs.getString(2), rs.getString(4).equals("1") ? true : false,
                                rs.getString(3).equals("FCO") ? StoreData.FCO_TYPE : StoreData.SCO_TYPE, rs.getString(6));
                        schema_data.add(data);
                    }
                }
                finally
View Full Code Here


        NodeList classElements = rootElement.getElementsByTagName("class");
        for (int i=0; i<classElements.getLength(); i++)
        {
            Element element = (Element) classElements.item(i);

            StoreData data = new StoreData(element.getAttribute("name"),
                element.getAttribute("type").equals("FCO") ? StoreData.FCO_TYPE : StoreData.SCO_TYPE);

            NamedNodeMap attributeMap = element.getAttributes();
            for (int j=0;j<attributeMap.getLength();j++)
            {
                Node attr = attributeMap.item(j);
                String attrName = attr.getNodeName();
                String attrValue = attr.getNodeValue();
                if (!attrName.equals("name") && !attrName.equals("type"))
                {
                    data.addProperty(attrName, attrValue);
                }
            }
            classes.add(data);
        }
View Full Code Here

     * @param mmd The metadata for the field.
     * @return The corresponding datastore container, or 'null'.
     */
    public synchronized DatastoreContainerObject getDatastoreContainerObject(AbstractMemberMetaData mmd)
    {
        StoreData sd = storeDataMgr.get(mmd);
        if (sd != null && sd instanceof MappedStoreData)
        {
            return ((MappedStoreData)sd).getDatastoreContainerObject();
        }
        else
View Full Code Here

        {
            NucleusLogger.PERSISTENCE.error(LOCALISER.msg("032015"));
            return null;
        }

        StoreData sd = storeDataMgr.get(className);
        if (sd != null && sd instanceof MappedStoreData)
        {
            ct = (DatastoreClass) ((MappedStoreData)sd).getDatastoreContainerObject();
            if (ct != null)
            {
View Full Code Here

    public synchronized DatastoreClass getDatastoreClass(DatastoreIdentifier name)
    {
        Iterator iterator = storeDataMgr.getManagedStoreData().iterator();
        while (iterator.hasNext())
        {
            StoreData sd = (StoreData) iterator.next();
            if (sd instanceof MappedStoreData)
            {
                MappedStoreData tsd = (MappedStoreData)sd;
                if (tsd.hasTable() && tsd.getDatastoreIdentifier().equals(name))
                {
View Full Code Here

            // Find subclasses who manage the tables winto which our class is persisted
            HashSet managingClasses=new HashSet();
            Iterator managedClassesIter = storeDataMgr.getManagedStoreData().iterator();
            while (managedClassesIter.hasNext())
            {
                StoreData data = (StoreData)managedClassesIter.next();
                if (data.isFCO() && ((AbstractClassMetaData)data.getMetaData()).getSuperAbstractClassMetaData() != null &&
                    ((AbstractClassMetaData)data.getMetaData()).getSuperAbstractClassMetaData().getFullClassName().equals(cmd.getFullClassName()))
                {
                    AbstractClassMetaData[] superCmds = getClassesManagingTableForClass((AbstractClassMetaData)data.getMetaData(), clr);
                    if (superCmds != null)
                    {
                        for (int i=0;i<superCmds.length;i++)
                        {
                            managingClasses.add(superCmds[i]);
View Full Code Here

    public DatastoreContainerObject getDatastoreContainerObject(AbstractMemberMetaData mmd)
    {
        schemaLock.readLock().lock();
        try
        {
            StoreData sd = storeDataMgr.get(mmd);
            if (sd != null && sd instanceof MappedStoreData)
            {
                return ((MappedStoreData)sd).getDatastoreContainerObject();
            }
            else
View Full Code Here

        }

        schemaLock.readLock().lock();
        try
        {
            StoreData sd = storeDataMgr.get(className);
            if (sd != null && sd instanceof MappedStoreData)
            {
                ct = (DatastoreClass) ((MappedStoreData)sd).getDatastoreContainerObject();
                if (ct != null)
                {
                    // Class known about
                    return ct;
                }
            }
        }
        finally
        {
            schemaLock.readLock().unlock();
        }

        // Class not known so consider adding it to our list of supported classes.
        // Currently we only consider PC classes
        boolean toBeAdded = false;
        if (clr != null)
        {
            Class cls = clr.classForName(className);
            ApiAdapter api = getApiAdapter();
            if (cls != null && !cls.isInterface() && api.isPersistable(cls))
            {
                toBeAdded = true;
            }
        }
        else
        {
            toBeAdded = true;
        }

        boolean classKnown = false;
        if (toBeAdded)
        {
            // Add the class to our supported list
            addClass(className, clr);

            // Retry
            schemaLock.readLock().lock();
            try
            {
                StoreData sd = storeDataMgr.get(className);
                if (sd != null && sd instanceof MappedStoreData)
                {
                    classKnown = true;
                    ct = (DatastoreClass) ((MappedStoreData)sd).getDatastoreContainerObject();
                }
View Full Code Here

        try
        {
            Iterator iterator = storeDataMgr.getManagedStoreData().iterator();
            while (iterator.hasNext())
            {
                StoreData sd = (StoreData) iterator.next();
                if (sd instanceof MappedStoreData)
                {
                    MappedStoreData tsd = (MappedStoreData)sd;
                    if (tsd.hasTable() && tsd.getDatastoreIdentifier().equals(name))
                    {
View Full Code Here

            // Find subclasses who manage the tables winto which our class is persisted
            HashSet managingClasses=new HashSet();
            Iterator managedClassesIter = storeDataMgr.getManagedStoreData().iterator();
            while (managedClassesIter.hasNext())
            {
                StoreData data = (StoreData)managedClassesIter.next();
                if (data.isFCO() && ((AbstractClassMetaData)data.getMetaData()).getSuperAbstractClassMetaData() != null &&
                    ((AbstractClassMetaData)data.getMetaData()).getSuperAbstractClassMetaData().getFullClassName().equals(cmd.getFullClassName()))
                {
                    AbstractClassMetaData[] superCmds = getClassesManagingTableForClass((AbstractClassMetaData)data.getMetaData(), clr);
                    if (superCmds != null)
                    {
                        for (int i=0;i<superCmds.length;i++)
                        {
                            managingClasses.add(superCmds[i]);
View Full Code Here

TOP

Related Classes of org.datanucleus.store.StoreData

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.