Re: Incorrect or not found field reference name

2006-09-20 Thread Kamal Bhatt

NM.

Worked it out. The reference-descriptor was pointing to the column 
heading instead of the id.


Cheers.

--
Kamal Bhatt


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



Incorrect or not found field reference name

2006-09-20 Thread Kamal Bhatt

Hi
I am trying to setup a many to many relationship, where the table that 
represents the many-to-many relationship cannot be anonymous. It works 
fine when I insert a value, but when I try to update a value I get the 
following error:


Incorrect or not found field reference name 'brand_class' in descriptor 
[EMAIL PROTECTED],cascade_store=none,cascade_delete=none,is_lazy=false,class_of_Items=class 
creative.beans.BrandClass] for class-descriptor 'creative.beans.BrandParam'


Now, brand_class is a field in the database, so I don't understand what 
it is complaining about.


Here are the related tables:

CREATE TABLE brand (
   brand_id CHARACTER VARYING(8) NOT NULL,
   brand_name CHARACTER VARYING NOT NULL,
   is_bookable BOOLEAN DEFAULT 'true' NOT NULL,
   agency_code CHARACTER VARYING(8),
   consultant_id CHARACTER VARYING(5),
   webbook_locn CHARACTER VARYING,
   is_white_label BOOLEAN DEFAULT 'true' NOT NULL,
   logo CHARACTER VARYING,
   colour_1 CHARACTER VARYING(6),
   colour_2 CHARACTER VARYING(6),
   enquiry_text CHARACTER VARYING,
   extra_cond CHARACTER VARYING,
   extra_info CHARACTER VARYING,
   contact_details CHARACTER VARYING,
   to_email_addr CHARACTER VARYING,
   from_email_addr CHARACTER VARYING,
   cc_email_addr CHARACTER VARYING,
   PRIMARY KEY (brand_id)
);

CREATE TABLE extra_enq_field (
   id SERIAL NOT NULL,
   brand CHARACTER VARYING(8) NOT NULL,
   label CHARACTER VARYING(15) NOT NULL,
   display_type CHARACTER VARYING(15) NOT NULL,
   PRIMARY KEY (id)
);

CREATE TABLE brand_class (
   id SERIAL NOT NULL,
   label VARCHAR(20) NOT NULL,
   is_required BOOLEAN DEFAULT 'false' NOT NULL,
   PRIMARY KEY(id)
);   


CREATE TABLE brand_param (
   brand VARCHAR(8) NOT NULL,
   brand_class integer NOT NULL,
   value VARCHAR,
   PRIMARY KEY(brand, brand_class)
);

I have created classes for all these functions. I will include 
BrandParam and BrandClass:


public class BrandParam implements Serializable
{

   public BrandParam()
   {
   }  


   public BrandParam(BrandClass inBrandClass)
   {
   mBrandClass = inBrandClass;
   mId = inBrandClass.getId();
   }   

   /* 
 
*/
   /** Obtain the value.
   */
   /* 
 
*/


   public String getValue() { return(mValue); }

   /* 
 
*/
   /** Obtain the brand class.
   */
   /* 
 
*/


   public BrandClass getBrandClass() { return(mBrandClass); }

   /* 
 
*/
   /** Wrapper for mBrandClass.getLabel.
   */
   /* 
 
*/


   public String getLabel() { return(mBrandClass.getLabel()); }

   /* 
 
*/
   /** Wrapper for mBrandClass.isRequired.
   */
   /* 
 
*/


   public boolean getIsRequired() { return(mBrandClass.getIsRequired()); }

   /* 
 
*/
   /** Wrapper for mBrandClass.getId.
   */
   /* 
 
*/


   public int getId() { return(mId); }
  
   /* 
 
*/

   /** Set value.*/
   /* 
 
*/
 
   public void setValue(String inValue) { mValue = inValue; }


   /* 
 
*/
   /** Set BrandClass.
   */
   /* 
 
*/
 
   public vo