I saw a similar topic --
viewtopic.php?p=2267123I have tried "lower case" of all database fields and it does not work.
This is the exception I get. java.sql.BatchUpdateException: Batch entry 0 insert into bt.users (username, password, admin_roles_id, id) values (raag5, password, 3, 110) was aborted. Call getNextException to see the cause.
org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2537)
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1328)
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:351)
org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2674)
org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
...
Here is the hbm.xml file<hibernate-mapping package="com.bizzytime.model" default-lazy="false">
<class name="User" table="bt.users">
<id name="id" type="java.lang.Long" column="id" unsaved-value="0">
<generator class="sequence">
<param name="sequence">bt.user_id_seq</param>
</generator>
</id>
<property name="username" column="username" type="string"/>
<property name="password" column="password" type="string"/>
<many-to-one name="role" class="AdminRole" fetch="select">
<column name="admin_roles_id" precision="4" scale="0" />
</many-to-one>
</class>
</hibernate-mapping>
Here is my tableCREATE TABLE bt.users
(
id bigint NOT NULL,
username character varying(32) NOT NULL,
"password" character varying(32) NOT NULL,
admin_roles_id bigint NOT NULL DEFAULT 1,
CONSTRAINT user_pk PRIMARY KEY (id),
CONSTRAINT user_admin_roles_fk FOREIGN KEY (admin_roles_id)
REFERENCES bt.admin_roles (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
OIDS=FALSE
);
ALTER TABLE bt.users OWNER TO postgres;
CREATE INDEX user_admin_roles_fk
ON bt.users
USING btree
(admin_roles_id);
The query can be executed successfully in pgAdmin III with single quotes around the text fieldsinsert into bt.users (username, password, admin_roles_id, id) values ('raag5', 'password', 3, 110)
I am running "postgresql-8.4.1-1-windows.exe" on Windows XPCould someone help me?
Thanks
-- Raag