/** * Get the properties and associated values that are in effect for the entity manager factory. * Changing the contents of the map does not change the configuration in effect. * @return properties */ public Map getProperties() { PersistenceConfiguration conf = ((ObjectManagerFactoryImpl)pmf).getOMFContext().getPersistenceConfiguration(); return conf.getOptions(); }
/** * Creates an object manager with datastore credentials. * * @param omf the object manager factory * @param owner the owning persistence manager or entity manager * @param userName the username to the datastore * @param password the password to the datastore */ public ForceObjectManagerImpl(ObjectManagerFactoryImpl omf, Object owner, String userName, String password) { super(omf, owner, userName, password); this.allOrNothingEnabled = omf.getOMFContext().getPersistenceConfiguration().getBooleanProperty("force.AllOrNothing"); }
/** * Creates an object manager with datastore credentials. * * @param omf the object manager factory * @param owner the owning persistence manager or entity manager * @param userName the username to the datastore * @param password the password to the datastore */ public ForceObjectManagerImpl(ObjectManagerFactoryImpl omf, Object owner, String userName, String password) { super(omf, owner, userName, password); this.allOrNothingEnabled = omf.getOMFContext().getPersistenceConfiguration().getBooleanProperty("force.AllOrNothing"); }
/** * Get the names of the properties that are supported for use with the entity manager factory. * These correspond to properties that may be passed to the methods of the EntityManagerFactory * interface that take a properties argument. These include all standard properties as well as * vendor-specific properties supported by the provider. These properties may or may not currently * be in effect. * @return properties and hints */ @SuppressWarnings("unchecked") public Set<String> getSupportedProperties() { PersistenceConfiguration conf = ((ObjectManagerFactoryImpl)pmf).getOMFContext().getPersistenceConfiguration(); return conf.getSupportedOptions(); }
omf.getOMFContext().getMetaDataManager().initialise(unitMetaData, omf.getOMFContext().getClassLoaderResolver(null));
/** * Constructor. * @param emf The parent EntityManagerFactory * @param pmf The underlying PersistenceManagerFactory that handles persistence * @param contextType The Persistence Context type */ public EntityManagerImpl(EntityManagerFactory emf, PersistenceManagerFactory pmf, PersistenceContextType contextType) { this.emf = emf; // Allocate our ObjectManager // TODO Remove the PM when we disconnect StateManager from PersistenceManager pm = pmf.getPersistenceManager(); om = ((JDOPersistenceManager)pm).getObjectManager(); ObjectManagerFactoryImpl omf = (ObjectManagerFactoryImpl)pmf; if (omf.getOMFContext().getPersistenceConfiguration().getStringProperty("datanucleus.TransactionType").equalsIgnoreCase( TransactionType.RESOURCE_LOCAL.toString())) { // Using ResourceLocal transaction so allocate a transaction tx = new EntityTransactionImpl(om); } }
/** * Constructor. * @param emf The parent EntityManagerFactory * @param pmf The underlying PersistenceManagerFactory that handles persistence * @param contextType The Persistence Context type */ public EntityManagerImpl(EntityManagerFactory emf, PersistenceManagerFactory pmf, PersistenceContextType contextType) { this.emf = emf; this.persistenceContextType = contextType; // Allocate our ObjectManager // TODO Remove the PM when we disconnect StateManager from PersistenceManager pm = pmf.getPersistenceManager(); om = ((JDOPersistenceManager)pm).getObjectManager(); ObjectManagerFactoryImpl omf = (ObjectManagerFactoryImpl)pmf; if (omf.getOMFContext().getPersistenceConfiguration().getStringProperty("datanucleus.TransactionType").equalsIgnoreCase( TransactionType.RESOURCE_LOCAL.toString())) { // Using ResourceLocal transaction so allocate a transaction tx = new EntityTransactionImpl(om); } CallbackHandler beanValidator = BeanValidatorHandlerFactory.newInstance(om); if (beanValidator!=null) { om.getCallbackHandler().addListener(beanValidator, null); } fetchPlan = new JPAFetchPlan(om.getFetchPlan()); }