This did strike my as potentially tricky to implement... perhaps too much so, it sounds.

- Chris

On Aug 10, 2007, at 6:12 AM, Andy Jefferson wrote:

In the case of a PC class with a field declared as

        @Column(name = "foo_bar", allowsNull = "false")
        int fooBar = 0;

It would be nice if the implementation would implicitly set the
default value for the column, as if the user had typed

        @Column(name = "foo_bar", allowsNull = "false", defaultValue = "0")
        int fooBar = 0;

Hi Chris,

I'm intrigued where you think the implementation is going to find this
information. When bytecode is generated (by the compiler) all such
initialisations are dumped into available constructor methods and there is no obvious way of determining what comes from the users provided constructor,
what comes from field initialisation, and what comes from static
initialisation. Consequently when an enhancer (BCEL, ASM etc) come across the
constructor method bytecode they can't separate it out easily.

Adding this to a specification would have to imply the process for how it is
possible since a "reference implementation" needs to be written.
Same issue as http://www.jpox.org/servlet/jira/browse/ENHANCER-96



--
Andy  (Java Persistent Objects - http://www.jpox.org)

Reply via email to