Package org.exolab.castor.jdo

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


    marshaller = new Marshaller( writer );
    marshaller.setMapping( _mapping );

    db.begin();
    marshaller.marshal( db.load( Product.class, new Integer( 4 ) ) );
    computerOql = db.getOQLQuery( "SELECT c FROM myapp.Computer c" );
    results = computerOql.execute();
    while( results.hasMore() )
      marshaller.marshal( results.next() );
    db.commit();
View Full Code Here


        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
            OID oid = (OID) results.next();
            db.load(Service.class, oid.getId());
            count++;
        }
       
        long iterate = System.currentTimeMillis();
       
View Full Code Here

        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
            OID oid = (OID) results.next();
            db.load(Service.class, oid.getId());
            count++;
        }
       
        long iterate = System.currentTimeMillis();
       
View Full Code Here

        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
            OID oid = (OID) results.next();
            db.load(Service.class, oid.getId(), Database.READONLY);
            count++;
        }
       
        long iterate = System.currentTimeMillis();
       
View Full Code Here

        long result = System.currentTimeMillis();
       
        int count = 0;
        while (results.hasMore()) {
            OID oid = (OID) results.next();
            db.load(Service.class, oid.getId(), Database.READONLY);
            count++;
        }
       
        long iterate = System.currentTimeMillis();
       
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());
        assertEquals(1, laptop.getId());
View Full Code Here

        laptop.setId(10);
        laptop.setName("laptop 10");
        laptop.setCpu("centrino");
        laptop.setResolution("1600");
        laptop.setWeight(2750);
        laptop.setDetail((ProductDetail) database.load(
                ProductDetail.class, new Integer(10)));
        database.create(laptop);

        Owner owner = new Owner ();
        owner.setId(new Integer (10));
View Full Code Here

        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());
        assertEquals(10, laptop.getId());
View Full Code Here

        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();
        try {
View Full Code Here

        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();
        try {
            laptop = (Laptop) database.load(Laptop.class, new Integer(10));
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.