Package org.exolab.castor.jdo

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


                counter += 1;
            }
        } else {
            fail("Query does not return any Computer instances.");
        }
        database.commit();
       
        database.close();
    }

    public void testQueryComputers () throws Exception {
View Full Code Here


                counter += 1;
            }
        } else {
            fail("Query does not return any Computer instances.");
        }
        database.commit();
       
        database.close();
    }

    public void testQueryLaptops () throws Exception {
View Full Code Here

                counter += 1;
            }
        } else {
            fail("Query does not return any Laptop instances.");
        }
        database.commit();
       
        database.close();
    }
   
    public void testQueryServers () throws Exception {
View Full Code Here

                counter += 1;
            }
        } else {
            fail("Query does not return any Server instances.");
        }
        database.commit();
       
        database.close();
    }

    public void testQueryProducts () throws Exception {
View Full Code Here

                counter += 1;
            }
        } else {
            fail("Query does not return any Product instances.");
        }
        database.commit();
       
        database.close();
    }
   
    public void testOQLQueryWithParameter () throws Exception {
View Full Code Here

            }
            assertNotNull(count);
            assertEquals(1, count.intValue());
        }
       
        database.commit();
       
        database.close();
    }
   
//    public void testOQLQueryWithoutParameter () throws Exception {
View Full Code Here

        statement.executeUpdate("create table prod_group (id int not null, name varchar(200) not null)");
        statement.executeUpdate("create table prod_detail (id int not null, prod_id int not null, name varchar(200) not null)");
        statement.executeUpdate("create table computer (id int not null, cpu varchar(200) not null)");
        statement.executeUpdate("create table category (id int not null, name varchar(200) not null)");
        statement.executeUpdate("create table category_prod (prod_id int not null, category_id int not null)");
        db.commit();
        db.close();
    }

    public void run() throws Exception
    {
View Full Code Here

                db.remove( product );
            }
        }

        LOG.info( "End transaction to remove Product objects" );
        db.commit();

        db.begin();
        LOG.info( "Begin transaction to remove Computer object" );
       
        // Look up the computer and if found in the database,
View Full Code Here

            LOG.debug( "Deleting existing computer: " + computer );
            db.remove( computer );
        }

        LOG.info( "End transaction to remove Computer objects" );
        db.commit();

        db.begin();
        LOG.info( "Begin transaction to remove Category objects" );

        // Look up the categories and if found in the database,
View Full Code Here

        database.begin();
       
        Product pc = new Product(1, "LCD", KindEnum.MONITOR);
        database.create(pc);

        database.commit();
        database.close();

        // load created product
        database = _category.getDatabase();
        database.begin();
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.