Package org.exolab.castor.jdo

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


    }

    public void testQueryOwner () throws Exception {
        Database database = _category.getDatabase();
       
        database.begin();
        OQLQuery query = database.getOQLQuery("select owner from "
                + Owner.class.getName() + " as owner");
        QueryResults results = query.execute();
       
        if (results.hasMore()) {
View Full Code Here


                "ctf.jdo.tc9x.Server"
        };
       
        Database database = _category.getDatabase();
       
        database.begin();
        OQLQuery query = database.getOQLQuery("select computer from "
                + Computer.class.getName() + " as computer order by computer.id");
        QueryResults results = query.execute();
       
        if (results.hasMore()) {
View Full Code Here

    }

    public void testQueryLaptops () throws Exception {
        Database database = _category.getDatabase();
       
        database.begin();
        OQLQuery query = database.getOQLQuery("select l from "
                + Laptop.class.getName() + " as l order by l.id");
        QueryResults results = query.execute();
       
        if (results.hasMore()) {
View Full Code Here

    }
   
    public void testQueryServers () throws Exception {
        Database database = _category.getDatabase();
       
        database.begin();
        OQLQuery query = database.getOQLQuery("select s from "
                + Server.class.getName() + " as s order by s.id");
        QueryResults results = query.execute();
       
        if (results.hasMore()) {
View Full Code Here

                "ctf.jdo.tc9x.Truck"
        };
       
        Database database = _category.getDatabase();
       
        database.begin();
        OQLQuery query = database.getOQLQuery("select product from "
                + Product.class.getName() + " as product order by product.id");
        QueryResults results = query.execute();
       
        if (results.hasMore()) {
View Full Code Here

    }
   
    public void testOQLQueryWithParameter () throws Exception {
        Database database = _category.getDatabase();
       
        database.begin();
        OQLQuery query = database.getOQLQuery("SELECT count(laptop.id) FROM "
                + Laptop.class.getName() + " laptop WHERE laptop.resolution = $1");
        query.bind("1024");
        QueryResults results = query.execute();
       
View Full Code Here

    }


    public void setup () throws Exception {
        Database db = _jdo.getDatabase();
        db.begin();
        Connection connection = db.getJdbcConnection();
        Statement statement = connection.createStatement();
        statement.executeUpdate("create table prod (id int not null, name varchar(200) not null, price numeric(18,2) not null,  group_id int not null)");
        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)");
View Full Code Here

        OQLQuery      computerOql;
        QueryResults  results;

        db = _jdo.getDatabase();

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

        // Look up the products and if found in the database,
        // delete them from the database
        productOql = db.getOQLQuery( "SELECT p FROM myapp.Product p WHERE p.id = $1" );
View Full Code Here

        }

        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,
        // delete ethis object from the database
        computerOql = db.getOQLQuery( "SELECT c FROM myapp.Computer c WHERE c.id = $1" );
View Full Code Here

        }

        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,
        // delete this object from the database
        categoryOql = db.getOQLQuery( "SELECT c FROM myapp.Category c WHERE c.id = $1" );
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.