openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miroslav Nachev <m...@space-comm.com>
Subject Re: Error instantiating named sequence "test.DataObjectsGenerator"
Date Mon, 17 Dec 2007 14:39:14 GMT
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package test;

import java.math.BigDecimal;
import org.apache.openjpa.jdbc.kernel.NativeJDBCSeq;
import org.apache.openjpa.kernel.StoreContext;
import org.apache.openjpa.meta.ClassMetaData;

/**
 *
 * @author Miro
 */
public class DataObjectsGenerator
    extends NativeJDBCSeq
    //implements Seq
    //extends ClassTableJDBCSeq
{
    public DataObjectsGenerator()
    {
        super();
        System.out.println("DataObjectsGenerator");
    }

    @Override
    public void setType(int arg0)
    {
        System.out.println("setType: type: " + arg0);
    }

    @Override
    public Object next(StoreContext arg0, ClassMetaData arg1)
    {
        System.out.println("next: StoreContext: " + arg0 + ", ClassMetaData: " + arg1);
        return new BigDecimal(System.currentTimeMillis()).toBigInteger();
    }

    @Override
    public Object current(StoreContext arg0, ClassMetaData arg1)
    {
        System.out.println("current: StoreContext:" + arg0 + ", ClassMetaData: " + arg1);
        return new BigDecimal(System.currentTimeMillis()).toBigInteger();
    }

    @Override
    public void allocate(int arg0, StoreContext arg1, ClassMetaData arg2)
    {
        System.out.println("allocate: additional: " + arg0 + "StoreContext:" + arg1 + ", ClassMetaData:
" + arg2);
    }

    @Override
    public void close()
    {
        System.out.println("close()");
    }

    /*@Override
    public Object next(StoreContext storeContext, ClassMetaData classMetaData)
    {
        System.out.println("next: classMetaData: " + classMetaData);
        Object next = super.next(storeContext, classMetaData);
        System.out.println("next: next: " + next);
        return next;
    }

    @Override
    protected Object nextInternal(JDBCStore jdbcStore, ClassMapping classMapping)
        throws Exception
    {
        System.out.println("nextInternal: classMapping: " + classMapping);
        Object next = super.nextInternal(jdbcStore, classMapping);
        System.out.println("nextInternal: next: " + next);
        return next;
    }

    @Override
    public void allocate(int arg0, StoreContext arg1, ClassMetaData arg2)
    {
        System.out.println("allocate: StoreContext:" + arg1 + ", ClassMetaData: " + arg2);
        super.allocate(arg0, arg1, arg2);
    }

    @Override
    protected void allocateInternal(int arg0, JDBCStore arg1, ClassMapping arg2)
        throws SQLException
    {
        System.out.println("allocateInternal: additional: " + arg0 + ", JDBCStore: " + arg1
+ ", ClassMapping: " + arg2);
        super.allocateInternal(arg0, arg1, arg2);
    }

    @Override
    public void close()
    {
        System.out.println("close()");
        super.close();
    }

    @Override
    public Object current(StoreContext arg0, ClassMetaData arg1)
    {
        System.out.println("current: StoreContext:" + arg0 + ", ClassMetaData: " + arg1);
        return super.current(arg0, arg1);
    }

    @Override
    public void setType(int arg0)
    {
        System.out.println("setType: "  + arg0);
        super.setType(arg0);
    }

    @Override
    public void addSchema(ClassMapping arg0, SchemaGroup arg1)
    {
        System.out.println("ClassMapping: " + arg0 + ", SchemaGroup: " + arg1);
        super.addSchema(arg0, arg1);
    }

    @Override
    public JDBCConfiguration getConfiguration()
    {
        JDBCConfiguration conf = super.getConfiguration();
        System.out.println("getConfiguration.JDBCConfiguration: " + conf);
        return conf;
    }*/

    
    

}

Mime
View raw message