/** * {@inheritDoc} */ public ObjectStore getObjectStore() { return osw.getObjectStore(); }
/** * {@inheritDoc} */ public ObjectStore getObjectStore() { return osw.getObjectStore(); }
/** * Constructor * * @param fetcher another EquivalentObjectFetcher */ public HintingFetcher(BaseEquivalentObjectFetcher fetcher) { super(fetcher.getModel(), fetcher.getIdMap(), fetcher.getLookupOs()); if (lookupOs instanceof ObjectStoreWriter) { lookupOs = ((ObjectStoreWriter) lookupOs).getObjectStore(); } this.hints = new EquivalentObjectHints(lookupOs); }
/** * {@inheritDoc} */ public void store(ReferenceList refList, Integer itemId) throws ObjectStoreException { ProxyReference proxy = new ProxyReference(osw.getObjectStore(), itemId, Item.class); refList.proxyItem(proxy); osw.store(refList); incrementTransaction(); }
/** * {@inheritDoc} */ public void store(Reference ref, Integer itemId) throws ObjectStoreException { ProxyReference proxy = new ProxyReference(osw.getObjectStore(), itemId, Item.class); ref.proxyItem(proxy); osw.store(ref); incrementTransaction(); }
/** * {@inheritDoc} */ public void store(Attribute att, Integer itemId) throws ObjectStoreException { ProxyReference proxy = new ProxyReference(osw.getObjectStore(), itemId, Item.class); att.proxyItem(proxy); osw.store(att); incrementTransaction(); }
/** * {@inheritDoc} */ public void store(ReferenceList refList, Integer itemId) throws ObjectStoreException { ProxyReference proxy = new ProxyReference(osw.getObjectStore(), itemId, Item.class); refList.proxyItem(proxy); osw.store(refList); incrementTransaction(); }
/** * {@inheritDoc} */ public void store(Attribute att, Integer itemId) throws ObjectStoreException { ProxyReference proxy = new ProxyReference(osw.getObjectStore(), itemId, Item.class); att.proxyItem(proxy); osw.store(att); incrementTransaction(); }
/** * {@inheritDoc} */ public void store(Reference ref, Integer itemId) throws ObjectStoreException { ProxyReference proxy = new ProxyReference(osw.getObjectStore(), itemId, Item.class); ref.proxyItem(proxy); osw.store(ref); incrementTransaction(); }
/** * Set the superuser flag and store it in userprofile database * @param isSuperUser if true the profile is set as superuser * @throws ObjectStoreException if an error occurs during storage of the object */ public void setSuperuser(boolean isSuperUser) throws ObjectStoreException { ObjectStoreWriter uosw = manager.getProfileObjectStoreWriter(); UserProfile p = (UserProfile) uosw.getObjectStore().getObjectById(userId, UserProfile.class); p.setSuperuser(isSuperUser); uosw.store(p); this.isSuperUser = isSuperUser; }
/** * Constructor * * @param fetcher another EquivalentObjectFetcher */ public HintingFetcher(BaseEquivalentObjectFetcher fetcher) { super(fetcher.getModel(), fetcher.getIdMap(), fetcher.getLookupOs()); if (lookupOs instanceof ObjectStoreWriter) { lookupOs = ((ObjectStoreWriter) lookupOs).getObjectStore(); } this.hints = new EquivalentObjectHints(lookupOs); }
/** * Set the superuser flag and store it in userprofile database * @param isSuperUser if true the profile is set as superuser * @throws ObjectStoreException if an error occurs during storage of the object */ public void setSuperuser(boolean isSuperUser) throws ObjectStoreException { ObjectStoreWriter uosw = manager.getProfileObjectStoreWriter(); UserProfile p = (UserProfile) uosw.getObjectStore().getObjectById(userId, UserProfile.class); p.setSuperuser(isSuperUser); uosw.store(p); this.isSuperUser = isSuperUser; }
public static void oneTimeSetUp(ObjectStoreWriter writer) throws Exception { ObjectStoreWriterTestCase.writer = writer; ObjectStoreTestUtils.deleteAllObjectsInStore(writer); os = writer.getObjectStore(); data = ObjectStoreTestUtils.getTestData("testmodel", "testmodel_data.xml"); }
public void setUp() throws Exception { super.setUp(); os = ObjectStoreFactory.getObjectStore("os.unittest"); userProfileOSW = ObjectStoreWriterFactory.getObjectStoreWriter("osw.userprofile-test"); userProfileOS = userProfileOSW.getObjectStore(); pm = new NonCheckingProfileManager(os, userProfileOSW); }
@Before public void setUp() throws Exception { osw = ObjectStoreWriterFactory.getObjectStoreWriter("osw.unittest"); os = osw.getObjectStore(); Map data = ObjectStoreTestUtils.getTestData("testmodel", "testmodel_data.xml"); ObjectStoreTestUtils.storeData(osw, data); }
@Before public void setUp() throws Exception { ObjectStoreWriter osw = ObjectStoreWriterFactory.getObjectStoreWriter("osw.unittest"); os = osw.getObjectStore(); Map data = ObjectStoreTestUtils.getTestData("testmodel", "testmodel_data.xml"); ObjectStoreTestUtils.storeData(osw, data); osw.close(); }
@BeforeClass public static void setUp() throws Exception { ObjectStoreWriter osw = ObjectStoreWriterFactory.getObjectStoreWriter("osw.unittest"); os = osw.getObjectStore(); Map data = ObjectStoreTestUtils.getTestData("testmodel", "testmodel_data.xml"); ObjectStoreTestUtils.storeData(osw, data); osw.close(); }
@Before public void setUp() throws Exception { osw = ObjectStoreWriterFactory.getObjectStoreWriter("osw.unittest"); os = osw.getObjectStore(); Map data = ObjectStoreTestUtils.getTestData("testmodel", "testmodel_data.xml"); ObjectStoreTestUtils.storeData(osw, data); runner = getRunner(true); runnerMatchAll = getRunner(false); }
/** * Delete all InterMineObjects from the objectstore. */ private void cleanObjects(ObjectStoreWriter osw) throws ObjectStoreException { Query q = new Query(); QueryClass queryClass = new QueryClass(InterMineObject.class); q.addToSelect(queryClass); q.addFrom(queryClass); SingletonResults r = osw.getObjectStore().executeSingleton(q); for (InterMineObject o: (List<InterMineObject>) ((List) r)) { osw.delete(o); } }
private void removeProfile() throws Exception { Query q = new Query(); QueryClass qc = new QueryClass(UserProfile.class); q.addFrom(qc); q.addToSelect(qc); QueryField qf = new QueryField(qc, "username"); SimpleConstraint sc = new SimpleConstraint(qf, ConstraintOp.EQUALS, new QueryValue("user")); q.setConstraint(sc); SingletonResults res = uosw.getObjectStore().executeSingleton(q); Iterator resIter = res.iterator(); while (resIter.hasNext()) { InterMineObject o = (InterMineObject) resIter.next(); uosw.delete(o); } }