Examples of PersistenceConfiguration


Examples of org.jpox.PersistenceConfiguration

public class JDOMetaDataHandlerTest extends TestCase
{
    public void testParseDefaultNamespace()
    {
        MetaDataParser parser = new MetaDataParser(new JDOMetaDataManager(new OMFContext(new PersistenceConfiguration(){})),true);
        MetaData md = parser.parseMetaDataURL(getClass().getResource("/org/jpox/metadata/xml/package1.jdo"), "jdo");
        assertNotNull(md);
    }
View Full Code Here

Examples of org.jpox.PersistenceConfiguration

        assertNotNull(md);
    }

    public void testParseNamespace()
    {
        MetaDataParser parser = new MetaDataParser(new JDOMetaDataManager(new OMFContext(new PersistenceConfiguration(){})),true);
        MetaData md = parser.parseMetaDataURL(getClass().getResource("/org/jpox/metadata/xml/package2.jdo"), "jdo");
        assertNotNull(md);
    }
View Full Code Here

Examples of org.jpox.PersistenceConfiguration

     */
    protected AbstractStoreManager(String key, ClassLoaderResolver clr, OMFContext omfContext)
    {
        this.storeManagerKey = key;
        this.omfContext = omfContext;
        PersistenceConfiguration conf = omfContext.getPersistenceConfiguration();
        this.readOnlyDatastore = conf.getBooleanProperty("org.jpox.readOnlyDatastore");
        this.readOnlyDatastoreAction = conf.getStringProperty("org.jpox.readOnlyDatastoreAction");
        this.fixedDatastore = conf.getBooleanProperty("org.jpox.fixedDatastore");
        this.autoStartMechanism = conf.getStringProperty("org.jpox.autoStartMechanism");

        // Register this StoreManager with the OMFContext
        omfContext.setStoreManager(this);

        this.poidManager = new PoidManager();
View Full Code Here

Examples of org.jpox.PersistenceConfiguration

     * @param ctxt OMF Context that this metadata manager operates in
     */
    public MetaDataManager(OMFContext ctxt)
    {
        this.omfContext = ctxt;
        PersistenceConfiguration conf = omfContext.getPersistenceConfiguration();
        JDOImplHelper.getInstance().removeRegisterClassListener(new MetaDataRegisterClassListener());
        this.setValidate(conf.getBooleanProperty("org.jpox.metadata.validate"));

        if (JavaUtils.isJRE1_5OrAbove())
        {
            try
            {
                ClassLoaderResolver clr = ctxt.getClassLoaderResolver(null);
                Class annotationReaderClass = clr.classForName(conf.getStringProperty("org.jpox.metadata.annotationManager"));

                Class[] ctrArgs = new Class[] {MetaDataManager.class};
                Object[] ctrParams = new Object[] {this};
                Constructor ctor = annotationReaderClass.getConstructor(ctrArgs);
                annotationManager = (AnnotationManager)ctor.newInstance(ctrParams);
View Full Code Here

Examples of org.jpox.PersistenceConfiguration

     */
    protected MappedStoreManager(String key, ClassLoaderResolver clr, OMFContext omfContext)
    {
        super(key, clr, omfContext);

        PersistenceConfiguration conf = omfContext.getPersistenceConfiguration();
        if (readOnlyDatastore || fixedDatastore)
        {
            autoCreateTables = false;
            autoCreateColumns = false;
            autoCreateConstraints = false;
        }
        else
        {
            boolean autoCreateSchema = conf.getBooleanProperty("org.jpox.autoCreateSchema");
            if (autoCreateSchema)
            {
                autoCreateTables = true;
                autoCreateColumns = true;
                autoCreateConstraints = true;
            }
            else
            {
                autoCreateColumns = conf.getBooleanProperty("org.jpox.autoCreateColumns");
                autoCreateTables = conf.getBooleanProperty("org.jpox.autoCreateTables");
                autoCreateConstraints = conf.getBooleanProperty("org.jpox.autoCreateConstraints");
            }
        }
        autoCreateWarnOnError = conf.getBooleanProperty("org.jpox.autoCreateWarnOnError");

        validateTables = conf.getBooleanProperty("org.jpox.validateTables");
        if (!validateTables)
        {
            validateColumns = false;
        }
        else
        {
            validateColumns = conf.getBooleanProperty("org.jpox.validateColumns");
        }
        validateConstraints = conf.getBooleanProperty("org.jpox.validateConstraints");
    }
View Full Code Here

Examples of org.jpox.PersistenceConfiguration

     * @param sm The state manager of the object to be inserted.
     * @throws JPOXDataStoreException when an error occurs in the datastore communication
     */
    public void insertObject(StateManager sm)
    {
        PersistenceConfiguration conf = storeMgr.getOMFContext().getPersistenceConfiguration();
        if (conf.getBooleanProperty("org.jpox.readOnlyDatastore"))
        {
            if (conf.getStringProperty("org.jpox.readOnlyDatastoreAction").equalsIgnoreCase("EXCEPTION"))
            {
                throw new DatastorePermissionException(LOCALISER.msg("032004",
                    StringUtils.toJVMIDString(sm.getObject())));
            }
            else
View Full Code Here

Examples of org.jpox.PersistenceConfiguration

     * @param fieldNumbers The numbers of the fields to be updated.
     * @throws JPOXDataStoreException when an error occurs in the datastore communication
     */
    public void updateObject(StateManager sm, int fieldNumbers[])
    {
        PersistenceConfiguration conf = storeMgr.getOMFContext().getPersistenceConfiguration();
        if (conf.getBooleanProperty("org.jpox.readOnlyDatastore"))
        {
            if (conf.getStringProperty("org.jpox.readOnlyDatastoreAction").equalsIgnoreCase("EXCEPTION"))
            {
                throw new DatastorePermissionException(LOCALISER.msg("032006",
                    StringUtils.toJVMIDString(sm.getObject())));
            }
            else
View Full Code Here

Examples of org.jpox.PersistenceConfiguration

     * @param sm The state manager of the object to be deleted.
     * @throws JPOXDataStoreException when an error occurs in the datastore communication
     */
    public void deleteObject(StateManager sm)
    {
        PersistenceConfiguration conf = storeMgr.getOMFContext().getPersistenceConfiguration();
        if (conf.getBooleanProperty("org.jpox.readOnlyDatastore"))
        {
            if (conf.getStringProperty("org.jpox.readOnlyDatastoreAction").equalsIgnoreCase("EXCEPTION"))
            {
                throw new DatastorePermissionException(LOCALISER.msg("032008",
                    StringUtils.toJVMIDString(sm.getObject())));
            }
            else
View Full Code Here

Examples of org.jpox.PersistenceConfiguration

                    {
                        // Obtain a new connection
                        // Note : it may be worthwhile to use the PM's connection here however where a Sequence doesnt yet
                        // exist the connection would then be effectively dead until the end of the tx
                        // The way around this would be to find a way of checking for existence of the sequence
                        PersistenceConfiguration conf = om.getOMFContext().getPersistenceConfiguration();
                        int isolationLevel = TransactionUtils.getTransactionIsolationLevelForName(conf.getStringProperty("org.jpox.poid.transactionIsolation"));
                        this.mconn = ((RDBMSManager)storeManager).getConnection(isolationLevel);
                    }
                    catch (SQLException e)
                    {
                        String msg = LOCALISER.msg("017006", e);
View Full Code Here

Examples of org.jpox.PersistenceConfiguration

     * Test the lookup of adapter from the product name.
     * @throws SQLException
     */
    public void testDatabaseProductNames() throws SQLException
    {
        OMFContext ctxt = new OMFContext(new PersistenceConfiguration(){});
        PluginManager pluginMgr = ctxt.getPluginManager();
        ClassLoaderResolver clr = ctxt.getClassLoaderResolver(null);

        RDBMSAdapterFactory factory = RDBMSAdapterFactory.getInstance();

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.