protected Collection getUnsupportedOptions() { Collection c = super.getUnsupportedOptions(); // remove options we do support but the abstract store doesn't c.remove(OpenJPAConfiguration.OPTION_ID_DATASTORE); c.remove(OpenJPAConfiguration.OPTION_OPTIMISTIC); // and add some that we don't support but the abstract store does c.add(OpenJPAConfiguration.OPTION_EMBEDDED_RELATION); c.add(OpenJPAConfiguration.OPTION_EMBEDDED_COLLECTION_RELATION); c.add(OpenJPAConfiguration.OPTION_EMBEDDED_MAP_RELATION); return c; }
public final void setContext(StoreContext ctx) { this.ctx = ctx; open(); }
/** * Factory method for constructing a {@link BrokerFactory} * from properties. Invoked from {@link Bootstrap#newBrokerFactory()}. */ public static AbstractStoreBrokerFactory newInstance (ConfigurationProvider cp) { // use a tmp store manager to get metadata about the capabilities of // this runtime Map map = cp.getProperties(); String storePlugin = (String) map.get(ProductDerivations .getConfigurationKey(PROP_ABSTRACT_STORE, map)); String storeCls = Configurations.getClassName(storePlugin); String storeProps = Configurations.getProperties(storePlugin); AbstractStoreManager store = createStoreManager(storeCls, storeProps); // populate configuration OpenJPAConfiguration conf = store.newConfiguration(); cp.setInto(conf); conf.supportedOptions().removeAll(store.getUnsupportedOptions()); // create and pool a new factory return new AbstractStoreBrokerFactory(conf, storeCls, storeProps, store.getPlatform()); }
/** * Assign a new datastore identity to the given instance. This given * value may be null. */ protected boolean assignDataStoreId(OpenJPAStateManager sm, Object val) { ClassMetaData meta = sm.getMetaData(); if (val == null && meta.getIdentityStrategy() != ValueStrategies.NATIVE) return false; if (val == null) val = getDataStoreIdSequence(meta).next(ctx, meta); sm.setObjectId(newDataStoreId(val, meta)); return true; }
public boolean assignObjectId(OpenJPAStateManager sm, boolean preFlush) { ClassMetaData meta = sm.getMetaData(); if (meta.getIdentityType() == ClassMetaData.ID_APPLICATION) return ApplicationIds.assign(sm, this, preFlush); // datastore identity Object val = ImplHelper.generateIdentityValue(ctx, meta, JavaTypes.LONG); return assignDataStoreId(sm, val); }
return Collections.EMPTY_LIST; return flush(pNew, pNewUpdated, pNewFlushedDeleted, pDirty, pDeleted);
/** * Factory method for constructing a {@link BrokerFactory} * from properties. Invoked from {@link Bootstrap#newBrokerFactory()}. */ public static AbstractStoreBrokerFactory newInstance (ConfigurationProvider cp) { // use a tmp store manager to get metadata about the capabilities of // this runtime Map map = cp.getProperties(); String storePlugin = (String) map.get(ProductDerivations .getConfigurationKey(PROP_ABSTRACT_STORE, map)); String storeCls = Configurations.getClassName(storePlugin); String storeProps = Configurations.getProperties(storePlugin); AbstractStoreManager store = createStoreManager(storeCls, storeProps); // populate configuration OpenJPAConfiguration conf = store.newConfiguration(); cp.setInto(conf); conf.supportedOptions().removeAll(store.getUnsupportedOptions()); // create and pool a new factory return new AbstractStoreBrokerFactory(conf, storeCls, storeProps, store.getPlatform()); }
/** * Assign a new datastore identity to the given instance. This given * value may be null. */ protected boolean assignDataStoreId(OpenJPAStateManager sm, Object val) { ClassMetaData meta = sm.getMetaData(); if (val == null && meta.getIdentityStrategy() != ValueStrategies.NATIVE) return false; if (val == null) val = getDataStoreIdSequence(meta).next(ctx, meta); sm.setObjectId(newDataStoreId(val, meta)); return true; }
public boolean assignObjectId(OpenJPAStateManager sm, boolean preFlush) { ClassMetaData meta = sm.getMetaData(); if (meta.getIdentityType() == ClassMetaData.ID_APPLICATION) return ApplicationIds.assign(sm, this, preFlush); // datastore identity Object val = ImplHelper.generateIdentityValue(ctx, meta, JavaTypes.LONG); return assignDataStoreId(sm, val); }
return Collections.EMPTY_LIST; return flush(pNew, pNewUpdated, pNewFlushedDeleted, pDirty, pDeleted);
/** * Factory method for constructing a {@link BrokerFactory} * from properties. Invoked from {@link Bootstrap#newBrokerFactory()}. */ public static AbstractStoreBrokerFactory newInstance (ConfigurationProvider cp) { // use a tmp store manager to get metadata about the capabilities of // this runtime Map map = cp.getProperties(); String storePlugin = (String) map.get(ProductDerivations .getConfigurationKey(PROP_ABSTRACT_STORE, map)); String storeCls = Configurations.getClassName(storePlugin); String storeProps = Configurations.getProperties(storePlugin); AbstractStoreManager store = createStoreManager(storeCls, storeProps); // populate configuration OpenJPAConfiguration conf = store.newConfiguration(); cp.setInto(conf); conf.supportedOptions().removeAll(store.getUnsupportedOptions()); // create and pool a new factory return new AbstractStoreBrokerFactory(conf, storeCls, storeProps, store.getPlatform()); }
/** * Assign a new datastore identity to the given instance. This given * value may be null. */ protected boolean assignDataStoreId(OpenJPAStateManager sm, Object val) { ClassMetaData meta = sm.getMetaData(); if (val == null && meta.getIdentityStrategy() != ValueStrategies.NATIVE) return false; if (val == null) val = getDataStoreIdSequence(meta).next(ctx, meta); sm.setObjectId(newDataStoreId(val, meta)); return true; }
protected Collection getUnsupportedOptions() { Collection c = super.getUnsupportedOptions(); // remove options we do support but the abstract store doesn't c.remove(OpenJPAConfiguration.OPTION_ID_DATASTORE); c.remove(OpenJPAConfiguration.OPTION_OPTIMISTIC); // and add some that we don't support but the abstract store does c.add(OpenJPAConfiguration.OPTION_EMBEDDED_RELATION); c.add(OpenJPAConfiguration.OPTION_EMBEDDED_COLLECTION_RELATION); c.add(OpenJPAConfiguration.OPTION_EMBEDDED_MAP_RELATION); return c; }
public boolean assignObjectId(OpenJPAStateManager sm, boolean preFlush) { ClassMetaData meta = sm.getMetaData(); if (meta.getIdentityType() == ClassMetaData.ID_APPLICATION) return ApplicationIds.assign(sm, this, preFlush); // datastore identity Object val = ImplHelper.generateIdentityValue(ctx, meta, JavaTypes.LONG); return assignDataStoreId(sm, val); }
public final void setContext(StoreContext ctx) { this.ctx = ctx; open(); }
return Collections.EMPTY_LIST; return flush(pNew, pNewUpdated, pNewFlushedDeleted, pDirty, pDeleted);
/** * Factory method for constructing a {@link BrokerFactory} * from properties. Invoked from {@link Bootstrap#newBrokerFactory()}. */ public static AbstractStoreBrokerFactory newInstance (ConfigurationProvider cp) { // use a tmp store manager to get metadata about the capabilities of // this runtime Map map = cp.getProperties(); String storePlugin = (String) map.get(ProductDerivations .getConfigurationKey(PROP_ABSTRACT_STORE, map)); String storeCls = Configurations.getClassName(storePlugin); String storeProps = Configurations.getProperties(storePlugin); AbstractStoreManager store = createStoreManager(storeCls, storeProps); // populate configuration OpenJPAConfiguration conf = store.newConfiguration(); cp.setInto(conf); conf.supportedOptions().removeAll(store.getUnsupportedOptions()); // create and pool a new factory return new AbstractStoreBrokerFactory(conf, storeCls, storeProps, store.getPlatform()); }
/** * Assign a new datastore identity to the given instance. This given * value may be null. */ protected boolean assignDataStoreId(OpenJPAStateManager sm, Object val) { ClassMetaData meta = sm.getMetaData(); if (val == null && meta.getIdentityStrategy() != ValueStrategies.NATIVE) return false; if (val == null) val = getDataStoreIdSequence(meta).next(ctx, meta); sm.setObjectId(newDataStoreId(val, meta)); return true; }
@SuppressWarnings({ "rawtypes", "unchecked" }) protected Collection getUnsupportedOptions() { Collection c = super.getUnsupportedOptions(); // remove options we do support but the abstract store doesn't // c.remove(OpenJPAConfiguration.OPTION_ID_DATASTORE); // c.remove(OpenJPAConfiguration.OPTION_OPTIMISTIC); // and add some that we don't support but the abstract store does // TODO take these out one by one c.add(OpenJPAConfiguration.OPTION_EMBEDDED_RELATION); c.add(OpenJPAConfiguration.OPTION_EMBEDDED_COLLECTION_RELATION); c.add(OpenJPAConfiguration.OPTION_EMBEDDED_MAP_RELATION); return c; }
public boolean assignObjectId(OpenJPAStateManager sm, boolean preFlush) { ClassMetaData meta = sm.getMetaData(); if (meta.getIdentityType() == ClassMetaData.ID_APPLICATION) return ApplicationIds.assign(sm, this, preFlush); // datastore identity Object val = ImplHelper.generateIdentityValue(ctx, meta, JavaTypes.LONG); return assignDataStoreId(sm, val); }