db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Jefferson <a...@jpox.org>
Subject Re: Implicitly setting @Column's defaultValue parameter
Date Fri, 10 Aug 2007 13:12:31 GMT
> 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)

View raw message