Package org.exolab.castor.jdo

Examples of org.exolab.castor.jdo.Database.begin()


     * Test method.
     * @throws Exception For any exception thrown.
     */
    public void testLoadChildWithCompoundId() throws Exception {
        Database db = _category.getDatabase();
        db.begin();
       
        ChildWithCompoundId child = (ChildWithCompoundId)
            db.load(ChildWithCompoundId.class,
                    new Identity(new Integer(1), new Integer(1)));

View Full Code Here


     * Test method.
     * @throws Exception For any exception thrown.
     */
    public void testQueryParent() throws Exception {
        Database db = _category.getDatabase();
        db.begin();
       
        OQLQuery query = db.getOQLQuery("SELECT entity FROM "
                + SelfReferentialParent.class.getName() + " entity WHERE id = $1");
        query.bind(new Integer(1));
        QueryResults results = query.execute();
View Full Code Here

     * Test method.
     * @throws Exception For any exception thrown.
     */
    public void testLoadParent() throws Exception {
        Database db = _category.getDatabase();
        db.begin();
       
        Object obj = db.load(SelfReferentialParent.class, new Integer(1));
        SelfReferentialParent entity = (SelfReferentialParent) obj;

        assertNotNull(entity);
View Full Code Here

     * Test method.
     * @throws Exception For any exception thrown.
     */
    public void testLoadChild() throws Exception {
        Database db = _category.getDatabase();
        db.begin();
       
        Object obj = db.load(SelfReferentialChild.class, new Integer(1));
        SelfReferentialChild child = (SelfReferentialChild) obj;

        assertNotNull(child);
View Full Code Here

    public void testDepends() throws Exception {
        Database db = null;
        MasterObject master = new MasterObject();
        master.setDescrip("This is the descrip.");
        db = _category.getDatabase();
        db.begin();
        db.create(master);
        db.commit();

        assertTrue(master.getId() != 0);
View Full Code Here

        db.commit();

        assertTrue(master.getId() != 0);

        //THIS Part Works!
        db.begin();
        DependentObject depends = new DependentObject();
        depends.setDescrip("Description");
        master.setDepends(depends);
        db.update(master);
        db.commit();
View Full Code Here

        db.commit();

        assertTrue(master.getId() != 0);
        int masterId = master.getId();

        db.begin();
        master = (MasterObject) db.load(MasterObject.class, new Integer(masterId));
        assertNotNull(master.getDepends());
        master.setDepends(null);
        db.commit();
View Full Code Here

        master = (MasterObject) db.load(MasterObject.class, new Integer(masterId));
        assertNotNull(master.getDepends());
        master.setDepends(null);
        db.commit();

        db.begin();
        master = (MasterObject) db.load(MasterObject.class, new Integer(masterId));
        assertNull(master.getDepends());
        db.commit();

        //THIS part doesn't!
View Full Code Here

        master = (MasterObject) db.load(MasterObject.class, new Integer(masterId));
        assertNull(master.getDepends());
        db.commit();

        //THIS part doesn't!
        db.begin();
        master = (MasterObject) db.load(MasterObject.class, new Integer(masterId));
        depends = new DependentObject();
        depends.setDescrip("Description");
        master.setDepends(depends);
        db.commit();
View Full Code Here

        depends = new DependentObject();
        depends.setDescrip("Description");
        master.setDepends(depends);
        db.commit();

        db.begin();
        master = (MasterObject) db.load(MasterObject.class, new Integer(masterId));
        assertNotNull(master.getDepends());
        db.commit();

        db.begin();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.