On Sat, 13 Mar 2004, Laurie Harper wrote: > I realise it has to match up on the Java/OJB side, but the table column > name can be anything, as in: > > <field-descriptor > name="someProperty" > column="THE_COLUMN" > jdbc-type="INTEGER" > nullable="true" > access="anonymous" > /> > > Basically, I'd like the 'name' property from ojb.field to control the > value of 'column'. Does that make sense?
You can use the column attribute of the ojb.field tag to achieve this. If no value is specified for the column attribute, the XDoclet module will use the java name (after some adjustments, e.g. for nested fields) or the value of the name attribute (for anonymous fields). As a general rule, almost all attributes in the repository descriptor have a corresponding attribute of the same name in the tag corresponding to the XML tag in the descriptor. E.g. to specify the column that a field maps to (XML attribute field-descriptor.column) you would use the attribute column of the tag ojb.field. Likewise for class-descriptor.table the attribute table of ojb.class. There are some exceptions where this wouldn't make sense either because the info is already present in the Java source (e.g. the name attribute of the descriptor) or is handled differently (usually easier e.g. nested fields). Tom --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
