I understand your point, but man that's harsh.  It implies that the 
table defaults be specified in two tiers, introducing a possible 
maintenance problem.  Actually, this is a bigger issue than just 
defaults - also triggers modifying data out from under an entity, 
sequences and auto-generated keys, etc.  I know the auto-gen key thing 
is addressed in jdk1.4, but 1) not all driver providers have implemented 
it and 2) not all app servers can use it yet.  When using entities - 
especially CMP ones - with rdbm's that use these features, it seems that 
changing your bean's commit-option isn't always enough.  Just me 
thinking out loud.

David

PS: Any idea when jbosscmp-jdbc.xml will support a tag that specifies 
auto-gen keys (implying it's running w/jdk1.4 and a jdbc driver that 
supports auto-gen keys)?

--

Dain Sundstrom wrote:
> Entity beans can't use database defaults.  The EJB spec requires that 
> all cmp-fields be initialized to Java defaults, so the defaults will 
> always be overwritten.  I suggest you set your defaults in the ejbCreate 
> method.
> 
> -dain
> 
> Saroj Kumar wrote:
> 
>> Hi All,
>>
>> I have a scenario which I think is very common.
>>
>> Some fields are defined as NOT NULL in DB but they do have DEFAULTS set.
>> If I don't include them in ejbCreate params then it fails to create any
>> Record.
>> Is there a way to specify that this value is to be taken from DB
>> If not defined in ejbCreate.
>>
>> How is this case handled? If I have to pass the value in ejbCreate()
>> Then I am unable to get the benefit of DB Defaults as I need to pass 
>> Them.
>>
>> Any ideas??
>>
>> TIA,
>> Saroj
>>



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to