-
1. Re: @Embeddable question
fernando_jmt May 21, 2007 9:30 AM (in response to anescu)Have you declared the ABC as follows?:
public class XYZ { ... private ABC abc = new ABC(); ... getters/setters }
In this case "abc" should be referenced in the view, not ABC.
HTH. -
2. Re: @Embeddable question
anescu May 21, 2007 9:39 AM (in response to anescu)Yes, I just tried and the same problem.
i also tried this one: I manually inserted the value into the DB (in xyz_abc_name field), so this one works like this, after that i deleted the value from the field and updated, all works ok.
Is possible I need to set not null value on the field in the constructor??? -
3. Re: @Embeddable question
anescu May 21, 2007 9:51 AM (in response to anescu)Correction:
It works to insert a new entity XYZ. But i have a script which inserts some rows into xyz tables without the xyz_abc_name field. If i select one of these entities and want to update the abc.name field to something then i get a validation error.
Anybody any idea how to solve this one? -
4. Re: @Embeddable question
fernando_jmt May 21, 2007 9:52 AM (in response to anescu)I make a mistake in my last post, the code shoul be:
public class XYZ { ... @Embedded private ABC abc = new ABC(); ... getters/setters }
And your ABC must have @Embeddable at type level.
do you have it in this way? -
5. Re: @Embeddable question
anescu May 21, 2007 9:58 AM (in response to anescu)Yes, i have them both. Earlier i had only the @Embeddable on class ABC, but i saw the @Embedded annotation in another post and used it.
So the insert works, but the update of some already inserted entities does not.