Package org.odmg

Examples of org.odmg.DBag


    {
        String name = "testDBag_" + System.currentTimeMillis();

        Transaction tx = odmg.newTransaction();
        tx.begin();
        DBag bag1 = odmg.newDBag();
        DBag bag2 = odmg.newDBag();
        DObject a, b, c, d, e;
        a = createObject(name);
        b = createObject(name);
        c = createObject(name);
        d = createObject(name);
        e = createObject(name);
        bag1.add(a);
        bag1.add(b);
        bag1.add(c);
        bag2.add(b);
        bag2.add(c);
        bag2.add(d);
        bag2.add(e);
        DBag bag3 = bag1.difference(bag2);
        assertEquals("should contain only 1 element", 1, bag3.size());

        bag3 = bag1.intersection(bag2);
        assertEquals("should contain two elements", 2, bag3.size());

        tx.commit();
    }
View Full Code Here


    {
        String name = "testDBag_" + System.currentTimeMillis();

        Transaction tx = odmg.newTransaction();
        tx.begin();
        DBag bag1 = odmg.newDBag();
        DBag bag2 = odmg.newDBag();
        DObject a, b, c, d, e;
        a = createObject(name);
        b = createObject(name);
        c = createObject(name);
        d = createObject(name);
        e = createObject(name);
        bag1.add(a);
        bag1.add(b);
        bag1.add(c);
        bag2.add(b);
        bag2.add(c);
        bag2.add(d);
        bag2.add(e);
        DBag bag3 = bag1.difference(bag2);
        assertEquals("should contain only 1 element", 1, bag3.size());

        bag3 = bag1.intersection(bag2);
        assertEquals("should contain two elements", 2, bag3.size());

        tx.commit();
    }
View Full Code Here

        Database db = odmg.newDatabase();
        //open database
        db.open(databaseName, Database.OPEN_READ_WRITE);
        Transaction tx = odmg.newTransaction();
        tx.begin();
        DBag bag1 = odmg.newDBag();
        DBag bag2 = odmg.newDBag();
        DListObject a, b, c, d, e;
        a = createObject(name);
        b = createObject(name);
        c = createObject(name);
        d = createObject(name);
        e = createObject(name);
        bag1.add(a);
        bag1.add(b);
        bag1.add(c);
        bag2.add(b);
        bag2.add(c);
        bag2.add(d);
        bag2.add(e);
        DBag bag3 = bag1.difference(bag2);
        assertEquals("should contain only 1 element", 1, bag3.size());

        bag3 = bag1.intersection(bag2);
        assertEquals("should contain two elements", 2, bag3.size());

        tx.commit();
    }
View Full Code Here

TOP

Related Classes of org.odmg.DBag

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.