Package org.jpox.metadata

Examples of org.jpox.metadata.PersistenceUnitMetaData


            }
            else if (localName.equals("persistence-unit"))
            {
                // New "persistence-unit"
                PersistenceFileMetaData filemd = (PersistenceFileMetaData)getStack();
                PersistenceUnitMetaData pumd = new PersistenceUnitMetaData(filemd,
                    getAttr(attrs, "name"), getAttr(attrs, "transaction-type"));
                filemd.addPersistenceUnit(pumd);
                pushStack(pumd);
            }
            else if (localName.equals("properties"))
            {
                // Do nothing
            }
            else if (localName.equals("property"))
            {
                // New "property" for the current persistence unit
                PersistenceUnitMetaData pumd = (PersistenceUnitMetaData)getStack();
                pumd.addProperty(getAttr(attrs, "name"), getAttr(attrs, "value"));
            }
            else if (localName.equals("mapping-file"))
            {
                // Processed elsewhere
            }
            else if (localName.equals("class"))
            {
                // Processed elsewhere
            }
            else if (localName.equals("jar-file"))
            {
                // Processed elsewhere
            }
            else if (localName.equals("jta-data-source"))
            {
                // Processed elsewhere
            }
            else if (localName.equals("non-jta-data-source"))
            {
                // Processed elsewhere
            }
            else if (localName.equals("description"))
            {
                // Processed elsewhere
            }
            else if (localName.equals("provider"))
            {
                // Processed elsewhere
            }
            else if (localName.equals("exclude-unlisted-classes"))
            {
                PersistenceUnitMetaData pumd = (PersistenceUnitMetaData)getStack();
                pumd.setExcludeUnlistedClasses();
            }
            else
            {
                String message = LOCALISER.msg("044037",qName);
                JPOXLogger.METADATA.error(message);
View Full Code Here


        Map pmfProps = new HashMap();

        // J2SE : Use "ResourceLocal" transactions by default
        pmfProps.put(JDO_TRANSACTION_TYPE_PROPERTY, TransactionType.RESOURCE_LOCAL.toString());

        PersistenceUnitMetaData pumd = null;
        if (props != null)
        {
            String persistenceUnitName =
                (String)props.get(JDO_PERSISTENCE_UNIT_NAME_PROPERTY);
            if (persistenceUnitName != null)
            {
                // Specified to use a "persistence-unit", so take any props defined for the unit
                try
                {
                    pumd = omfContext.getMetaDataManager().getMetaDataForPersistenceUnit(persistenceUnitName);
                    if (pumd != null)
                    {
                        // Add the properties for the unit
                        if (pumd.getProperties() != null)
                        {
                            pmfProps.putAll(pumd.getProperties());
                        }
                    }
                    else
                    {
                        throw new JDOUserException(LOCALISER_JDO.msg("012004", persistenceUnitName));
                    }

                    if (omfContext.getApi().equalsIgnoreCase("JPA"))
                    {
                        pumd.clearJarFiles(); // Dont use JARs when in J2SE for JPA
                    }
                }
                catch (JPOXException jpe)
                {
                    throw new JDOUserException(LOCALISER_JDO.msg("012005", persistenceUnitName));
View Full Code Here

            {
                msg = LOCALISER.msg("Enhancer.PersistenceUnit", puName);
                addMessage(msg);
            }

            PersistenceUnitMetaData pumd = null;
            try
            {
                pumd = metaDataMgr.getMetaDataForPersistenceUnit(puName);
            }
            catch (JPOXException jpe)
View Full Code Here

        }

        // Create a PersistenceUnitMetaData
        if (unitInfo.getTransactionType() == PersistenceUnitTransactionType.JTA)
        {
            unitMetaData = new PersistenceUnitMetaData(null, unitInfo.getPersistenceUnitName(),
                TransactionType.JTA.toString());
        }
        else if (unitInfo.getTransactionType() == PersistenceUnitTransactionType.RESOURCE_LOCAL)
        {
            unitMetaData = new PersistenceUnitMetaData(null, unitInfo.getPersistenceUnitName(),
                TransactionType.RESOURCE_LOCAL.toString());
        }
       
        // Classes
        List<String> classNames = unitInfo.getManagedClassNames();
View Full Code Here

TOP

Related Classes of org.jpox.metadata.PersistenceUnitMetaData

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.