Oops, I've made a big mistake.
I think I really need hollidays.
I have a required column named COD in a table.
Torque will generate these methods in the object model :
- void setCOD(String cod)
- void setCOD(StringKey cod)
- StringKey getCOD()
Java Introspector will not be able to find the getter for the COD attribute
because it constructs in memory a list of methods in the following order :
- COD : (for the String version)
* write method setCOD
* read method : none
- COD : (for the StringKey version)
* write method setCOD
* read method : getCOD
So if you use reflection to extract the value of the COD atribute without
having made any reference in your code to the object the introspector will
choose the first entry and will find that no getter is available.
There are three workarounds :
- construct a bean info which gives the association (getCOD, setCOD) for the
StringKey version and suppress the setter for the String version
- use the attribute in the new version of Torque to suppress the overloading of
the setters (thanks John, I did not notice this new feature)
- use the model of Marc-Antoine which inverse the order in the model generation
Arnaud DESSERT.
-------------------------------------------------
This message may contain confidential and
proprietary material for the sole use of the
intended recipient. Any review or distribution by
others is stricly prohibited. If you are not the
intended recipient, please contact the sender and
delete all copies.
Ce message est exclusivement destin� aux personnes
dont le nom figure ci-dessus. Il peut contenir des
informations confidentielles dont la divulgation
est � ce titre rigoureusement interdite. Dans
l'hypoth�se o� vous auriez re�u ce message par
erreur, merci de le renvoyer � l'adresse e-mail
ci-dessus, et de d�truire toute copie.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>