Package org.exolab.castor.jdo

Examples of org.exolab.castor.jdo.JDOManager


    }

    public void testIntEntities() throws Exception {
        JdoConf jdoConf = createJdoConf("int");
        JDOManager.loadConfiguration(jdoConf, getJdoConfBaseURL());
        JDOManager jdo = JDOManager.createInstance(DBNAME + "-int");

        Database db = jdo.getDatabase();
        db.begin();

        OQLQuery query = db.getOQLQuery("SELECT e FROM "
                + IntEntity.class.getName() + " e WHERE is_defined(property)");
        QueryResults results = query.execute();
View Full Code Here


    }

    public void testIntAndDoubleEntities() throws Exception {
        JdoConf jdoConf = createJdoConf("int-and-double");
        JDOManager.loadConfiguration(jdoConf, getJdoConfBaseURL());
        JDOManager jdo = JDOManager.createInstance(DBNAME + "-int-and-double");
       
        Database db = jdo.getDatabase();
        db.begin();
       
        OQLQuery query = db.getOQLQuery("SELECT e FROM "
                + IntAndDoubleEntity.class.getName() + " e WHERE is_defined(property)");
        QueryResults results = query.execute();
View Full Code Here

    }

    public void testIntAndIntegerEntities() throws Exception {
        JdoConf jdoConf = createJdoConf("int-and-integer");
        JDOManager.loadConfiguration(jdoConf, getJdoConfBaseURL());
        JDOManager jdo = JDOManager.createInstance(DBNAME + "-int-and-integer");
       
        Database db = jdo.getDatabase();
        db.begin();
       
        OQLQuery query = db.getOQLQuery("SELECT e FROM "
                + IntAndIntegerEntity.class.getName() + " e WHERE is_defined(property)");
        QueryResults results = query.execute();
View Full Code Here

    }

    public void testIntegerEntities() throws Exception {
        JdoConf jdoConf = createJdoConf("integer");
        JDOManager.loadConfiguration(jdoConf, getJdoConfBaseURL());
        JDOManager jdo = JDOManager.createInstance(DBNAME + "-integer");
       
        Database db = jdo.getDatabase();
        db.begin();
       
        OQLQuery query = db.getOQLQuery("SELECT e FROM "
                + IntegerEntity.class.getName() + " e WHERE is_defined(property)");
        QueryResults results = query.execute();
View Full Code Here

    }

    public void testIntegerAndDoubleEntities() throws Exception {
        JdoConf jdoConf = createJdoConf("integer-and-double");
        JDOManager.loadConfiguration(jdoConf, getJdoConfBaseURL());
        JDOManager jdo = JDOManager.createInstance(DBNAME + "-integer-and-double");
       
        Database db = jdo.getDatabase();
        db.begin();
       
        OQLQuery query = db.getOQLQuery("SELECT e FROM "
                + IntegerAndDoubleEntity.class.getName()
                + " e WHERE is_defined(property)");
View Full Code Here

    }
   
    public void testLoadNullIntAndIntegerEntities() throws Exception {
        JdoConf jdoConf = createJdoConf("int-and-integer");
        JDOManager.loadConfiguration(jdoConf, getJdoConfBaseURL());
        JDOManager jdo = JDOManager.createInstance(DBNAME + "-int-and-integer");
       
        Database db = jdo.getDatabase();
       
        db.begin();
        IntAndIntegerEntity iEnt = (IntAndIntegerEntity) db.load(
                IntAndIntegerEntity.class, new Integer(5));
        db.commit();
View Full Code Here

    public boolean exclude(final DatabaseEngineType engine) {
        return (engine == DatabaseEngineType.SQL_SERVER);
    }
       
    public void delete() throws Exception {
        JDOManager jdo = getJDOManager(DBNAME, MAPPING);
       
        // Delete all records to avoid problems with previous runs
        Connection conn = jdo.getConnectionFactory().createConnection();
        conn.setAutoCommit(true);
        conn.createStatement().execute("DELETE FROM test87_extended");
        conn.createStatement().execute("DELETE FROM test87_base");
        conn.close();
       
        LOG.debug("Deleted all records from database.");

        // Expire all objects in cache
        Database db = jdo.getDatabase();
        db.getCacheManager().expireCache();
        db.close();
       
        LOG.debug("Expired all objects from cache.");
    }
View Full Code Here

            || (engine == DatabaseEngineType.ORACLE)
            || (engine == DatabaseEngineType.SQL_SERVER);
    }
   
    public void delete() throws Exception {
        JDOManager jdo = getJDOManager(DBNAME, MAPPING);
       
        // Delete all records to avoid problems with previous runs
        Connection conn = jdo.getConnectionFactory().createConnection();
        conn.setAutoCommit(true);
        conn.createStatement().execute("DELETE FROM test87_product");
        conn.createStatement().execute("DELETE FROM test87_group");
        conn.close();
       
        LOG.debug("Deleted all records from database.");

        // Expire all objects in cache
        Database db = jdo.getDatabase();
        db.getCacheManager().expireCache();
        db.close();
       
        LOG.debug("Expired all objects from cache.");
    }
View Full Code Here

    public void service( HttpServletRequest request, XMLServletResponse response )
        throws ServletException
    {
        try {
            JDOManager           jdo;
            Database      db;
            OQLQuery      oql;
            Object        result;
            Marshaller    marshal;

            // Set the output type and stylesheet
            // response.setContentType( "text/html" );
            response.setOutputMethod( "html" );
            response.setStylesheet( new InputSource( getClass().getResourceAsStream( "xslt.xsl" ) ) );
            // For XML document
            /*
            response.setContentType( "text/xml" );
             */

            // Load the mapping from the specified filed, and Open up the
            // database for read/write access
            JDOManager.loadConfiguration(getClass().getResource( DatabaseFile ).toString());
            jdo = JDOManager.createInstance ("test");
            db = jdo.getDatabase();

            // All ODMG database access requires a transaction
            db.begin();

            // Construct a new query to load all the products in the database
View Full Code Here

TOP

Related Classes of org.exolab.castor.jdo.JDOManager

Copyright © 2018 www.massapicom. 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.