Package org.exolab.castor.jdo

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


        database.begin();
        database.remove(database.load(Laptop.class, new Integer(10)));
        database.remove(database.load(ProductDetail.class, new Integer(10)));
        database.commit();
       
        database.begin();
        try {
            laptop = (Laptop) database.load(Laptop.class, new Integer(10));
            fail("Laptop with id 10 still exists.");
        } catch (ObjectNotFoundException e) {
           assertEquals("The object of type ctf.jdo.tc9x.Laptop with identity <10(10)> "
View Full Code Here


   
    public void testReadWriteCached() throws Exception {
        long start = System.currentTimeMillis();
       
        Database db =  _jdo.getDatabase();
        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

    }

    public void testLoadLaptopMulti() throws Exception {
        Database database = _category.getDatabase();
       
        database.begin();
        LaptopMulti laptop = (LaptopMulti) database.load(LaptopMulti.class,
                new Identity(new Integer (1), new Integer(1)));
        database.commit();
       
        assertNotNull(laptop);
View Full Code Here

    public void testReadOnlyEmpty() 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

    }

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

    }

    public void testLoadServerMulti() throws Exception {
        Database database = _category.getDatabase();
       
        database.begin();
        ServerMulti server = (ServerMulti) database.load(ServerMulti.class,
                new Identity(new Integer(3), new Integer(3)));
        database.commit();
       
        assertNotNull(server);
View Full Code Here

   
    public void testReadOnlyCached() throws Exception {
        long start = System.currentTimeMillis();
       
        Database db =  _jdo.getDatabase();
        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

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

    }
   
    public void testCreateAndLoadComputer() throws Exception {
        Database database = _category.getDatabase();

        database.begin();
        Order order = new Order();
        order.setId(12);
        order.setName("order 12");
        database.create(order);
        database.commit();
View Full Code Here

    public void testReadWriteOidEmpty() throws Exception {
        long start = System.currentTimeMillis();
       
        Database db =  _jdo.getDatabase();
        db.getCacheManager().expireCache();
        db.begin();
       
        long begin = System.currentTimeMillis();
       
        OQLQuery query = db.getOQLQuery(
                "CALL SQL select PTF_SERVICE.ID as 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.