275276277278279280281282283284285
// test versions assigned after update long oldVersion = artist.getSnapshotVersion(); artist.setArtistName(artist.getArtistName() + "---"); context.commitChanges(); assertFalse(oldVersion == artist.getSnapshotVersion()); assertEquals(context .getObjectStore() .getCachedSnapshot(artist.getObjectId())
302303304305306307308309310311312
object.setObjectId(new ObjectId( "Artist", Artist.ARTIST_ID_PK_COLUMN, new Integer(3))); context.commitChanges(); assertEquals(PersistenceState.COMMITTED, object.getPersistenceState()); // refetch context.invalidateObjects(Collections.singleton(object));
156157158159160161162163164165166
loadSystemCodes(dataContext); // Load post codes data file loadPostCodes(dataContext); dataContext.commitChanges(); } private static void loadFile(String filename, DataContext dataContext, LineProcessor lineProcessor) throws IOException {
311312313314315316317318319320321
if (list.size() < 60) { dataContext.deleteObjects(list); loadCustomers(dataContext); dataContext.commitChanges(); } } catch (Throwable t) { t.printStackTrace();
163164165166167168169170171172173
loadCourses(dataContext); // Load student houses data file loadStudentHouses(dataContext); dataContext.commitChanges(); } private static void loadFile(String filename, DataContext dataContext, LineProcessor lineProcessor) throws IOException {
372373374375376377378379380381382
if (list.size() < 60) { dataContext.deleteObjects(list); loadCustomers(dataContext); dataContext.commitChanges(); } loadQuartzJobs(schedulerService); } catch (Throwable t) {
126127128129130131132133134135136
public void savePreferences() { DataContext context = this.dataContext; if (context != null) { context.commitChanges(); } } protected Domain getPreferenceDomain() { Domain defaultDomain = getDomain(this.defaultDomain, true);
5657585960616263646566
ReflexiveAndToOne o2 = context .newObject(ReflexiveAndToOne.class); o2.setName("o2"); o2.setToParent(o1); context.commitChanges(); Expression qualifier = ExpressionFactory.matchExp("children", o2); List parents = context.performQuery(new SelectQuery( ReflexiveAndToOne.class, qualifier));
8687888990919293949596
ReflexiveAndToOne o2 = context .newObject(ReflexiveAndToOne.class); o2.setName("o2"); o2.setToParent(o1); context.commitChanges(); Expression qualifier = ExpressionFactory.matchExp("toParent", o1); List children = context.performQuery(new SelectQuery( ReflexiveAndToOne.class, qualifier));
7475767778798081828384
DataContext context = createDataContext(); assertSame(getDomain(), context.getParentDataDomain()); Artist a = context.newObject(Artist.class); a.setArtistName("aa"); context.commitChanges(); context.invalidateObjects(Collections.singleton(a)); blockQueries(); try {