| Author |
How to tell a CMP to ignore a field on insert?
|
Rusty Enisin
Ranch Hand
Joined: May 26, 2005
Posts: 107
|
|
Our database will not allow the CMP to insert a value for a timestamp because there is a trigger that does it. The trigger sets the value on insert so the CMP cannot. If the CMP sets the value, I get an error. Unfortunately, the CMP tries to insert a value for ALL fields. In order to get the app to work I had to remove the field. But I really need this field value later on in the app. Is there a way to tell the CMP to ignore that field on insert?
|
The squeaky wheel gets the grease. Well, that or replaced...
|
 |
Karthik Guru
Ranch Hand
Joined: Mar 06, 2001
Posts: 1209
|
|
|
Its been a while since i did entity beans. But will having just a getter for that field help?
|
 |
Rusty Enisin
Ranch Hand
Joined: May 26, 2005
Posts: 107
|
|
Yeah. I thought that too. But the EJB framework (2.0 is what I am using...) requires both a setter and a getter for each field.
|
 |
rajeev rana
Greenhorn
Joined: Dec 30, 2004
Posts: 5
|
|
Rusty, you would define the abstract getters and setters for your Entity EJB as per 2.0 specification, What you need to modify is your create method. Here you won't invoke the setter for the field which you don't want to set at insertion.
|
 |
 |
|
|
subject: How to tell a CMP to ignore a field on insert?
|
|
|