Discussion:
[Middlegen-user] The read-only persistence attributes is not working
Rod Macpherson
2003-09-05 16:33:07 UTC
Permalink
This is an XDoclet issue but does anybody know why the read-only
attribute here has no effect? I added the read-only attribute to the
entity-cmp-20.vm velocity script when the field was a PK column. The
idea was to make all of my auto-generated PK columns read-only.

I posted the following commet in the JIRA issue tracker for middlegen:

____________________________________________________________________

I want to make my primary key read-only since it is generated in the
database. Therefore INSERT or UPDATE statements should exclude this.
Unfortunately the read-only attribute of ejb.persistence does not do
anything in terms of generating a read-only DD attribute.

/**
* @ejb.pk-field
* @ejb.persistent-field
* @ejb.persistence column-name="FOO" read-only="true"
*/
public abstract java.lang.Long getFoo();

____________________________________________________________________
Loading...