Package org.exolab.castor.jdo

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


        database.begin();
        database.update(car);
        database.commit();
       
        database.begin();
        car = (Car) database.load(Car.class, new Integer(5));
        database.commit();
       
        assertNotNull(car);
        assertEquals("ctf.jdo.tc9x.Car", car.getClass().getName());
        assertEquals(5, car.getId());
View Full Code Here


        database.begin();
        database.update(car);
        database.commit();
       
        database.begin();
        car = (Car) database.load(Car.class, new Integer(5));
        database.commit();

        assertNotNull(car);
        assertEquals("ctf.jdo.tc9x.Car", car.getClass().getName());
        assertEquals(5, car.getId());
View Full Code Here

    public void testLoadAndUpdateProduct() throws Exception {
        Database database = _category.getDatabase();
       
        database.begin();
        Product product = (Product) database.load(Product.class, new Integer(5));
        database.commit();
       
        assertNotNull(product);
        assertEquals("ctf.jdo.tc9x.Product", product.getClass().getName());
        assertEquals(5, product.getId());
View Full Code Here

        Database db = null;
        boolean valid = true;
        try {
            db = this._category.getDatabase();
            db.begin();
            ManyGroup group = (ManyGroup) db.load(ManyGroup.class, new Integer(groupId));
            if (group.getValue1().compareTo(expectedValue) != 0) {
                log("validReadTransaction: value in group " + group.getId()
                        + " does not match expected value, value: " + group.getValue1()
                        + ", expected: " + expectedValue);
                valid = false;
View Full Code Here

        database.begin();
        database.update(product);
        database.commit();
       
        database.begin();
        product = (Product) database.load(Product.class, new Integer(5));
        database.commit();
       
        assertNotNull(product);
        assertEquals("ctf.jdo.tc9x.Product", product.getClass().getName());
        assertEquals(5, product.getId());
View Full Code Here

        log("validating write transaction for group " + groupId + "...");
        Database db = null;
        try {
            db = this._category.getDatabase();
            db.begin();
            ManyGroup group = (ManyGroup) db.load(ManyGroup.class, new Integer(groupId));
            group.setValue1(JDO_UPDATED_VALUE);
            Iterator itor = group.getPeople().iterator();
            while (itor.hasNext()) {
                ManyPerson person = (ManyPerson) itor.next();
                person.setValue1(JDO_UPDATED_VALUE);
View Full Code Here

        database.begin();
        database.update(product);
        database.commit();
       
        database.begin();
        product = (Product) database.load(Product.class, new Integer(5));
        database.commit();

        assertNotNull(product);
        assertEquals("ctf.jdo.tc9x.Product", product.getClass().getName());
        assertEquals(5, product.getId());
View Full Code Here

        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);
        database.commit();
       
        int laptopId = laptop.getId();
       
View Full Code Here

       
        int laptopId = laptop.getId();
       
        database.begin();
        laptop = (LaptopKeyGen)
                database.load(LaptopKeyGen.class, new Integer(laptopId));
        database.commit();
       
        assertNotNull(laptop);
        assertEquals("ctf.jdo.tc9x.LaptopKeyGen", laptop.getClass().getName());
        assertEquals(laptopId, laptop.getId());
View Full Code Here

        assertEquals("ctf.jdo.tc9x.LaptopKeyGen", laptop.getClass().getName());
        assertEquals(laptopId, laptop.getId());
        assertEquals("laptop 10", laptop.getName());
       
        database.begin();
        database.remove(database.load(LaptopKeyGen.class, new Integer(laptopId)));
        database.commit();
       
        database.begin();
        try {
            laptop = (LaptopKeyGen)
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.