Package org.exolab.castor.jdo

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


   
    public void testReadOnlyOidCached() throws Exception {
        long start = System.currentTimeMillis();
       
        Database db = _jdo.getDatabase();
        db.begin();
       
        long begin = System.currentTimeMillis();
       
        OQLQuery query = db.getOQLQuery(
                "CALL SQL select PTF_SERVICE.ID as ID "
View Full Code Here


   
    public void testReadOnlyOidOnly() throws Exception {
        long start = System.currentTimeMillis();
       
        Database db = _jdo.getDatabase();
        db.begin();
       
        long begin = System.currentTimeMillis();
       
        OQLQuery query = db.getOQLQuery(
                "CALL SQL select PTF_SERVICE.ID as ID "
View Full Code Here

                //ResultScrollpane.getViewport().remove(
                //    ResultScrollpane.getViewport().getComponent(0));
                // create a new conec
                Database db = _jdo.getDatabase();
                db.begin();

                 /**
                    * add query to the history,
                    * maybe it's important lo loglso querys that won't work
                    * for this reason it's logged before creation
View Full Code Here

        super.tearDown();
    }
   
    public void testQueryEntity() throws Exception {
        Database db = _jdo.getDatabase();
        db.begin();
       
        OQLQuery query = db.getOQLQuery("SELECT entity FROM "
                + Entity.class.getName() + " entity WHERE id = $1");
        query.bind(new Integer(1));
        QueryResults results = query.execute();
View Full Code Here

    }

    public void testLoadLaptop() throws Exception {
        Database database = _category.getDatabase();
       
        database.begin();
        Laptop laptop = (Laptop) database.load(Laptop.class, new Integer(1));
        database.commit();
       
        assertNotNull(laptop);
        assertEquals("ctf.jdo.tc9x.Laptop", laptop.getClass().getName());
View Full Code Here

    }

    public void testCreateAndLoadLaptop() throws Exception {
        Database database = _category.getDatabase();
       
        database.begin();
        ProductDetail detail = new ProductDetail();
        detail.setId(10);
        detail.setCategory("category 10");
        detail.setLocation("location 10");
        database.create(detail);
View Full Code Here

        detail.setLocation("location 10");
        database.create(detail);
        database.commit();
       
       
        database.begin();
        Laptop laptop = new Laptop();
        laptop.setId(10);
        laptop.setName("laptop 10");
        laptop.setCpu("centrino");
        laptop.setResolution("1600");
View Full Code Here

        owner.setId(new Integer (10));
        owner.setName("owner 10");
        owner.setProduct(laptop);
        database.commit();
       
        database.begin();
        laptop = (Laptop) database.load (Laptop.class, new Integer(10));
        database.commit();
       
        assertNotNull (laptop);
        assertEquals("ctf.jdo.tc9x.Laptop", laptop.getClass().getName());
View Full Code Here

        assertNotNull (laptop);
        assertEquals("ctf.jdo.tc9x.Laptop", laptop.getClass().getName());
        assertEquals(10, laptop.getId());
        assertEquals("laptop 10", laptop.getName());
       
        database.begin();
        database.remove(database.load(Laptop.class, new Integer(10)));
        database.remove(database.load(ProductDetail.class, new Integer(10)));
        database.commit();
       
        database.begin();
View Full Code Here

    public void testReadWriteEmpty() throws Exception {
        long start = System.currentTimeMillis();
       
        Database db =  _jdo.getDatabase();
        db.getCacheManager().expireCache();
        db.begin();
       
        long begin = System.currentTimeMillis();
       
        OQLQuery query = db.getOQLQuery(
                "SELECT o FROM " + Service.class.getName() + " o order by o.id");
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.