I'm new to OJB, but I have done several projects with Hibernate and EJB
Entity beans, so I'm not completely a newbie. I've switched from RC5 to RC6
so I'm on the latest version (for purposes of using the latest XDoclet
features). Here's my problem. I'm trying to use HSQLDB's (1.7.1) identiy
fields to generate primary keys. Here's my setting for the sequence manager:

=====================================

<sequence-manager
className="org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl" />

=====================================
And this is the basic class:

=====================================
/**
 * Account class maps to accounts in the database
 *
 * @ojb.class table = "account"
 */
public class Account {

        /**
         * identifier
         *
         * @ojb.field
         *              primarykey = "true"
         *              column = "account_id"
         *      autoincrement = "database"
         *              access = "readonly"
         */
        private int id;

        /**
         * username of this account
         *
         * @ojb.field
         *              column = "username"
         *              length = "12"
         */
        private String username;

        /**
         * Password of this account
         *
         * @todo look into encypting this. MD5?
         * @ojb.field
         *              column = "password"
         *              length = "64"
         */
        private String password;

        /**
         * First Name
         *
         * @ojb.field
         *              column = "fname"
         *              length = "32"
         */
        private String firstName;

        /**
         * Last Name
         *
         * @ojb.field
         *              column = "lname"
         *              length = "32"
         */
        private String lastName;

        /**
         * empty constructor
         */
        public Account() {
                this.address2=null;
                this.roles=new java.util.ArrayList();
        }


...

}
=====================================



And finally, here's the error I'm running into:

=====================================
   [junit] Running com.alloy.hipe.business.TestAccountLogic
    [junit] Tests run: 2, Failures: 0, Errors: 1, Time elapsed: 1.438 sec
    [junit] Testsuite: com.alloy.hipe.business.TestAccountLogic
    [junit] Tests run: 2, Failures: 0, Errors: 1, Time elapsed: 1.438 sec
    [junit] ------------- Standard Output ---------------
    [junit] - Can't save Account: SQL failure while insert object data for
class com.alloy.hipe.bean.Account, PK of the given object is [ id=-2],
object was [EMAIL PROTECTED], exception message is [Wrong
data type]
    [junit] ------------- ---------------- ---------------
    [junit] Testcase: testLogin took 1.328 sec
    [junit] Testcase: testAddAcount took 0.078 sec

=====================================


I'm at a loss; the setup was working in R5 and now I'm back to square one.
Any ideas?

- Fred


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to