Package org.exolab.castor.jdo

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


        order.setId(12);
        order.setName("order 12");
        database.create(order);
        database.commit();

        database.begin();
        ProductDetail detail = new ProductDetail();
        detail.setId(12);
        detail.setCategory("category 12");
        detail.setLocation("location 12");
        database.create(detail);
View Full Code Here


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

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

        Collection orders = new LinkedList();
        orders.add(database.load(Order.class, new Integer(12)));
        laptop.setOrders(orders);
        database.commit();

        database.begin();
        Computer computer = (Computer) database.load(Computer.class, new Integer(12));
        database.commit();
       
        assertNotNull(computer);
        assertEquals("ctf.jdo.tc9x.Laptop", computer.getClass().getName());
View Full Code Here

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

   
    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

     * Test method.
     * @throws Exception For any exception thrown.
     */
    public void testQueryEntityOne() throws Exception {
        Database db = _category.getDatabase();
        db.begin();
        OQLQuery aquery = db.getOQLQuery(
                "SELECT c FROM " + Container.class.getName() + " c");
        QueryResults aresults = aquery.execute();
        int i = 1;
        while (aresults.hasMore()) {
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

    }

    public void testLoadComputerMulti() throws Exception {
        Database database = _category.getDatabase();
       
        database.begin();
        ComputerMulti computer = (LaptopMulti) database.load(ComputerMulti.class,
                new Identity(new Integer(1), new Integer(1)));
        database.commit();
       
        assertNotNull(computer);
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.