Package org.exolab.castor.jdo

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


            db.create(cc);

            LazyContractCategory cc2 = new LazyContractCategory();
            cc2.setId(102);
            cc2.setName("Full-time employee");
            db.create(cc2);
           
            ArrayList category = new ArrayList();
            category.add(cc);
            category.add(cc2);
View Full Code Here


            con.setContractNo(78);
            con.setEmployee(person);
            con.setCategory(category);
            person.setContract(con);
           
            db.create(person);
           
            db.commit();
            db.close();
        } catch (Exception e) {
            LOG.error("createTestDataSet: exception caught", e);
View Full Code Here

        Book myBook = new Book();
        myBook.setIsbn(1235);
        myBook.setTitle("My Definition");

        db.begin();
        db.create(myBook);
        db.commit();

        db.begin();
        Book lookup = (Book) db.load(Book.class, new Long(1235));
        assertNotNull(lookup);
View Full Code Here

    public void createValid() throws Exception {
        Database db = getJDOManager(DBNAME, MAPPING).getDatabase();
        db.begin();

        Entity entity = new Entity(null, Entity.DEFAULT_NAME);
        db.create(entity);
       
        db.commit();
        db.close();
    }
   
View Full Code Here

        Database db = getJDOManager(DBNAME, MAPPING).getDatabase();
        db.begin();

        Entity entity = new Entity(null, null);
        try {
            db.create(entity);
            fail("Expected SQLException");
        } catch (PersistenceException ex) {
            assertTrue(ex.getCause() instanceof SQLException);
        }
       
View Full Code Here

            state.setChangeFrom((count % 3) == 1);
            state.setChangeTo((count % 3) == 2);
            state.setCreated(date, "user");
            state.setUpdated(date, "user");
           
            db.create(state);

            countLocked = (countLocked < LOCKED_MAX) ? (countLocked + 1) : 1;
            count++;
        }
       
View Full Code Here

            dept.setName("department " + count);
            dept.setState(state);
            dept.setCreated(date, "user");
            dept.setUpdated(date, "user");
           
            db.create(dept);
           
            countState = (countState < STATE_MAX) ? (countState + 1) : 1;
            count++;
        }
       
View Full Code Here

            reason.setName("reason " + count);
            reason.setFailure((count % 2) == 0);
            reason.setCreated(date, "user");
            reason.setUpdated(date, "user");
           
            db.create(reason);
           
            count++;
        }
       
        db.commit();
View Full Code Here

            supplier.setId(new Integer(count));
            supplier.setName("supplier " + count);
            supplier.setCreated(date, "user");
            supplier.setUpdated(date, "user");
           
            db.create(supplier);
           
            count++;
        }
       
        db.commit();
View Full Code Here

            type.setId(new Integer(count));
            type.setNumber(new Integer(5000 + count).toString());
            type.setCreated(date, "user");
            type.setUpdated(date, "user");
           
            db.create(type);
           
            count++;
        }
       
        db.commit();
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.