Package org.datanucleus

Examples of org.datanucleus.ObjectManagerImpl


    {
        emf = theEMF;
        persistenceContextType = contextType;

        // Allocate our ObjectManager
        om = new ObjectManagerImpl(nucleusCtx, new JPAPersistenceManager(this),
            nucleusCtx.getPersistenceConfiguration().getStringProperty("datanucleus.ConnectionUserName"),
            nucleusCtx.getPersistenceConfiguration().getStringProperty("datanucleus.ConnectionPassword"));

        if (nucleusCtx.getPersistenceConfiguration().getStringProperty("datanucleus.TransactionType").equalsIgnoreCase(
            TransactionType.RESOURCE_LOCAL.toString()))
View Full Code Here


     * @param userName Username for the datastore
     * @param password Password for the datastore
     */
    public JDOPersistenceManager(JDOPersistenceManagerFactory apmf, String userName, String password)
    {
        om = new ObjectManagerImpl(apmf.getNucleusContext(), this, userName, password);
        this.pmf = apmf;
        userObject = null;
        userObjectMap = null;
        fetchPlan = new JDOFetchPlan(om.getFetchPlan());
        setTransaction(om.getTransaction());
View Full Code Here

     * @userStory xyz
     */
    public void testMetadataCache() throws Exception {
        Object delegate = em.getDelegate();
        Assert.assertNotNull(delegate);
        ObjectManagerImpl om = (ObjectManagerImpl) delegate;
        ForceStoreSchemaHandler forceSH = (ForceStoreSchemaHandler) om.getStoreManager().getSchemaHandler();
        // Search for an entity that we know is used by the tests
        Assert.assertNotNull(forceSH.getTable("TestEntity"));
        // Search for an entity that we know is NOT used by the tests
        Assert.assertNull(forceSH.getTable("Task"));
    }
View Full Code Here

     * @userStory xyz
     */
    public void testTransientFields() throws Exception {
        Object delegate = em.getDelegate();
        Assert.assertNotNull(delegate);
        ObjectManagerImpl om = (ObjectManagerImpl) delegate;
        ForceStoreSchemaHandler forceSH = (ForceStoreSchemaHandler) om.getStoreManager().getSchemaHandler();
        // Search for TestEntity
        TableImpl table = forceSH.getTable("TestEntity");
        Assert.assertNotNull(table.getColumnByForceApiName("lastModifiedDate"));
        Assert.assertNull(table.getColumnByForceApiName("unused"));
        // Do the same test with TestEntityMethodAnnotations
View Full Code Here

    public void testNotNullFieldsInternal(EntityManager emm) throws Exception {
        deleteAll(RestrictedTestEntity.class);
       
        Object delegate = emm.getDelegate();
        Assert.assertNotNull(delegate);
        ObjectManagerImpl om = (ObjectManagerImpl) delegate;
        // Search for RestrictedTestEntity
        AbstractClassMetaData cmd =
            ((ForceStoreManager) om.getStoreManager()).getMetaDataManager()
                                    .getMetaDataForEntityName(RestrictedTestEntity.class.getSimpleName());
        Assert.assertFalse(cmd.getMetaDataForMember("requiredName").getColumnMetaData()[0].getAllowsNull());
        Assert.assertTrue(cmd.getMetaDataForMember("optionalName").getColumnMetaData()[0].getAllowsNull());
        // Do some CRUD operations
        RestrictedTestEntity entity = new RestrictedTestEntity();
View Full Code Here

    public void testUniqueFieldsInternal(EntityManager emm, boolean allOrNothing) throws Exception {
        deleteAll(RestrictedTestEntity.class);
       
        Object delegate = emm.getDelegate();
        Assert.assertNotNull(delegate);
        ObjectManagerImpl om = (ObjectManagerImpl) delegate;
        // Search for RestrictedTestEntity
        AbstractClassMetaData cmd =
            ((ForceStoreManager) om.getStoreManager()).getMetaDataManager()
                                    .getMetaDataForEntityName(RestrictedTestEntity.class.getSimpleName());
        Assert.assertTrue(cmd.getMetaDataForMember("requiredName").getColumnMetaData()[0].getUnique());
        Assert.assertFalse(cmd.getMetaDataForMember("optionalName").getColumnMetaData()[0].getUnique());
        // Do some CRUD operations
        RestrictedTestEntity entity1 = new RestrictedTestEntity();
View Full Code Here

     * @param userName Username for the datastore
     * @param password Password for the datastore
     */
    public JDOPersistenceManager(JDOPersistenceManagerFactory apmf, String userName, String password)
    {
        objectMgr = new ObjectManagerImpl(apmf, this, userName, password);
        this.pmf = apmf;
        userObject = null;
        userObjectMap = null;
        fetchPlan = new JDOFetchPlan(objectMgr.getFetchPlan());
        setTransaction(objectMgr.getTransaction());
View Full Code Here

TOP

Related Classes of org.datanucleus.ObjectManagerImpl

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.