Hello Patrik,

i don´t have a good solution in the moment.
I´m thinking about generating sql-statements for cleaning the database or
generating some cleaning code into repositories or something like that :-/ .

thx



Patrik Nordwall wrote:
> 
> If it is not supported by jpa/hibernate it is not much we can do. You have
> to do the housekeeping yourself somehow. Or do you have any suggestion of
> solution that we can generate for this type of association?
> /Patrik
> 
> Markus Flögel wrote:
>> 
>> Hello Patrik,
>> 
>> yes i tried the cascade="all-delete-orphan" on singleContactChannel. The
>> casacde annotation was generated in the source but the old contactChannel
>> wasn´t deleted in the database. The problem is that hibernate doesn´t
>> support the delete-orphan for ManyToOne relations.
>> i´m using the JPA/Hibernate with annotations.
>> 
>> 
>> 
>> Patrik Nordwall wrote:
>>> 
>>> Have you tried  cascade="all-delete-orphan" on  singleContactChannel
>>> also?
>>> illsill add better support for aggregates soon and then 
>>> all-delete-orphan will be default for aggregates. 
>>> 
>>> Markus Flögel wrote:
>>>> 
>>>> hello,
>>>> 
>>>> i have a problem changing  Entities and ValueObjects.
>>>> i have a simple structur:
>>>> 
>>>> Entity UserData
>>>> {
>>>>    scaffold
>>>>    
>>>>    String lastName length="256";
>>>>    String  firstName length="256";
>>>> 
>>>>    - List<@ContactChannel> contactChannels cascade="all-delete-orphan";
>>>> 
>>>>    - @ContactChannel singleContactChannel; 
>>>> }
>>>> 
>>>> ValueObject ContactChannel
>>>> {
>>>>    String identifier length="256";
>>>>    Boolean business;
>>>>    String addon nullable length="256";
>>>> }
>>>> 
>>>> 1. When i change the singleContactChannel  on a UserData entity and
>>>> save the entity, then the new singleContactChannel is saved in the
>>>> database but the old one is not deleted. Is there a way to solve this
>>>> problem? I know that the relation between the Entity and the
>>>> ValueObject is generated as an ManyToOne Relation and Hibernate can´t
>>>> delete-orphan these relation. I don´t want to use a bidirectional
>>>> relation.
>>>> 
>>>> 
>>>> 2. On the List with contactChannels the delete-orphan works fine. But i
>>>> have to define explicit the cascade="all-delete-orphan" in my model. Is
>>>> there a way to generated the delete-orphan automatically because its an
>>>> relation between entity and valueobject? 
>>>> 
>>>> thx markus
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Sculptor-1.8.0-ValueObject-delete-orphan-tp28175885s17564p28222207.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Fornax-developer mailing list
Fornax-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to