Dear All,
I am getting an error viz. Attribute "name" must be declared for element type "param" when trying generate a sequential id.
The created Sequence goes like this:
- Sequence: public.id_custgroup_sequence
CREATE SEQUENCE public.id_custgroup_sequence INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1;
SELECT setval('public.id_custgroup_sequence', 2);
My Table goes like this:
CREATE TABLE public.dummysequence (
dummyid int4 DEFAULT nextval('id_custgroup_sequence'::text) NOT NULL,
name varchar(8),
CONSTRAINT dummysequence_pkey PRIMARY KEY (dummyid)
) WITH OIDS;
I have written a value object for both the fields in the above table and written a HBM file as follows:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping.dtd">
<hibernate-mapping>
<class name="com.phoenixcolor.pcs.vo.customergroup.SerialVO" table="dummysequence">
<id name="dummyid" column="dummyid">
<generator class="sequence">
<param name="sequence">id_custgroup_sequence</param>
</generator>
</id>
<property name="name" column="name"/>
</class>
</hibernate-mapping>
In the application I am trying to save the value object by providing value for the second field i.e. name and expecting hibernate to take care of dummyid value in the table. But found that the hbm is not getting deployed, and the result is the following error.
Attribute "name" must be declared for element type "param".
Thanks in anticipation.
_________________ Ravi Kumar
|