Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » [Teneo+Hibernate]Help! A hibernate mapping question
| | |
Re: [Teneo+Hibernate]Help! A hibernate mapping question [message #84453 is a reply to message #84440] |
Tue, 22 May 2007 09:09 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Anthony,
Model refers to one instance of Network and one instance of OptimizedResult and you want the
features of Network and OptimizedResult to be mapped to the same table as Model. When a Model is
saved also the Network and OptimizedResult are saved.
Is this what you want?
gr. Martin
Anthony wrote:
> Martin,
>
> Thank you for help.
>
> I just learn to write my mapping file.
>
> It seems that when a new persistable object was saved
> a new record will be inserted into its mapped table.
>
> In my case, the sample structure of my EMF model list below:
>
> Model
> |____Network
> |
> |____OptimizedResult
>
>
> There is a table called T_Model which will store all the attribute in
>
> Model,Netwrok and OptimizedResult.
>
> So I cannot map 3 classes into T_Model.
>
> But I am not sure if it is possible to map into DB View.
>
>
> Regards,
>
> Anthony
>
>
>
>> Hi Anthony,
>> I think you mean embedded but to be sure can you give a small example
>> of what you want to achieve?
>>
>> gr. Martin
>>
>> Anthony wrote:
>>> Hi,
>>>
>>> I have several classes in a EMF model and these classes will be
>>> mapped
>>> into ONE table . How to write the mapping file to only let one class
>>> to insert/update/delete the table record and the others just mapped
>>> to some fields?
>>>
>>> Thanks in advance!
>>>
>>>
>>> Anthony
>>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
| |
Re: [Teneo+Hibernate]Help! A hibernate mapping question [message #84479 is a reply to message #84465] |
Tue, 22 May 2007 09:21 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Anthony,
To achieve this you can set the @Embedded annotation in the ereferences Model.Network and
Model.OptimizedResult.
If there are nameclashes between Network, OptimizedResult and Model then you can use
@AttributeOverrides.
gr. Martin
Anthony wrote:
> Martin,
>
> Exactly.
>
>
> Anthony
>
>> Anthony,
>> Model refers to one instance of Network and one instance of
>> OptimizedResult and you want the features of Network and
>> OptimizedResult to be mapped to the same table as Model. When a Model
>> is saved also the Network and OptimizedResult are saved.
>> Is this what you want?
>>
>> gr. Martin
>>
>> Anthony wrote:
>>> Martin,
>>>
>>> Thank you for help.
>>>
>>> I just learn to write my mapping file.
>>>
>>> It seems that when a new persistable object was saved
>>> a new record will be inserted into its mapped table.
>>>
>>> In my case, the sample structure of my EMF model list below:
>>>
>>> Model
>>> |____Network
>>> |
>>> |____OptimizedResult
>>>
>>>
>>> There is a table called T_Model which will store all the attribute
>>> in
>>>
>>> Model,Netwrok and OptimizedResult.
>>>
>>> So I cannot map 3 classes into T_Model.
>>>
>>> But I am not sure if it is possible to map into DB View.
>>>
>>>
>>> Regards,
>>>
>>> Anthony
>>>
>>>
>>>
>>>> Hi Anthony,
>>>> I think you mean embedded but to be sure can you give a small
>>>> example of what you want to achieve?
>>>>
>>>> gr. Martin
>>>>
>>>> Anthony wrote:
>>>>> Hi,
>>>>>
>>>>> I have several classes in a EMF model and these classes will be
>>>>> mapped
>>>>> into ONE table . How to write the mapping file to only let one
>>>>> class to insert/update/delete the table record and the others just
>>>>> mapped to some fields?
>>>>>
>>>>> Thanks in advance!
>>>>>
>>>>>
>>>>> Anthony
>>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: [Teneo+Hibernate]Help! A hibernate mapping question [message #84489 is a reply to message #84479] |
Tue, 22 May 2007 10:02 |
Anthony Lee Messages: 114 Registered: July 2009 |
Senior Member |
|
|
Martin,
OK. I will try it.
I have another question :
In my case ,the model structure list as below:
Network
|________ProductCatalog
| |_______Product collection
|
|________CustomerCatlog
|_______Customer collection
When UI want to show product collections,
the ProductCatalog object will act as collection's
parent object to avoid getting customer collecitons.
(If no ***catalog, ContentProvider will return Network's children)
Do I have to have table to mapped ***Catalog class?
Anthony
> Anthony,
> To achieve this you can set the @Embedded annotation in the
> ereferences Model.Network and Model.OptimizedResult.
>
> If there are nameclashes between Network, OptimizedResult and Model
> then you can use @AttributeOverrides.
>
> gr. Martin
>
> Anthony wrote:
>> Martin,
>>
>> Exactly.
>>
>>
>> Anthony
>>
>>> Anthony,
>>> Model refers to one instance of Network and one instance of
>>> OptimizedResult and you want the features of Network and
>>> OptimizedResult to be mapped to the same table as Model. When a
>>> Model is saved also the Network and OptimizedResult are saved.
>>> Is this what you want?
>>>
>>> gr. Martin
>>>
>>> Anthony wrote:
>>>> Martin,
>>>>
>>>> Thank you for help.
>>>>
>>>> I just learn to write my mapping file.
>>>>
>>>> It seems that when a new persistable object was saved
>>>> a new record will be inserted into its mapped table.
>>>>
>>>> In my case, the sample structure of my EMF model list below:
>>>>
>>>> Model
>>>> |____Network
>>>> |
>>>> |____OptimizedResult
>>>>
>>>>
>>>> There is a table called T_Model which will store all the
>>>> attribute in
>>>>
>>>> Model,Netwrok and OptimizedResult.
>>>>
>>>> So I cannot map 3 classes into T_Model.
>>>>
>>>> But I am not sure if it is possible to map into DB View.
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Anthony
>>>>
>>>>
>>>>
>>>>> Hi Anthony,
>>>>> I think you mean embedded but to be sure can you give a small
>>>>> example of what you want to achieve?
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> Anthony wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I have several classes in a EMF model and these classes will be
>>>>>> mapped
>>>>>> into ONE table . How to write the mapping file to only let one
>>>>>> class to insert/update/delete the table record and the others
>>>>>> just mapped to some fields?
>>>>>>
>>>>>> Thanks in advance!
>>>>>>
>>>>>>
>>>>>> Anthony
>>>
>>
>
>
|
|
|
Re: [Teneo+Hibernate]Help! A hibernate mapping question [message #84501 is a reply to message #84489] |
Tue, 22 May 2007 10:10 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Anthony,
You can try to set @Embedded also on Network.ProductCatalog/CustomerCatalog to get it into the same
table as Model and Network. Is that whay you want/mean?
gr. Martin
Anthony wrote:
> Martin,
>
> OK. I will try it.
>
> I have another question :
>
> In my case ,the model structure list as below:
>
> Network
> |________ProductCatalog
> | |_______Product collection
> |
> |________CustomerCatlog
> |_______Customer collection
>
>
> When UI want to show product collections,
> the ProductCatalog object will act as collection's
> parent object to avoid getting customer collecitons.
>
> (If no ***catalog, ContentProvider will return Network's children)
>
>
> Do I have to have table to mapped ***Catalog class?
>
>
> Anthony
>
>
>
>
>
>
>> Anthony,
>> To achieve this you can set the @Embedded annotation in the
>> ereferences Model.Network and Model.OptimizedResult.
>>
>> If there are nameclashes between Network, OptimizedResult and Model
>> then you can use @AttributeOverrides.
>>
>> gr. Martin
>>
>> Anthony wrote:
>>> Martin,
>>>
>>> Exactly.
>>>
>>>
>>> Anthony
>>>
>>>> Anthony,
>>>> Model refers to one instance of Network and one instance of
>>>> OptimizedResult and you want the features of Network and
>>>> OptimizedResult to be mapped to the same table as Model. When a
>>>> Model is saved also the Network and OptimizedResult are saved.
>>>> Is this what you want?
>>>>
>>>> gr. Martin
>>>>
>>>> Anthony wrote:
>>>>> Martin,
>>>>>
>>>>> Thank you for help.
>>>>>
>>>>> I just learn to write my mapping file.
>>>>>
>>>>> It seems that when a new persistable object was saved
>>>>> a new record will be inserted into its mapped table.
>>>>>
>>>>> In my case, the sample structure of my EMF model list below:
>>>>>
>>>>> Model
>>>>> |____Network
>>>>> |
>>>>> |____OptimizedResult
>>>>>
>>>>>
>>>>> There is a table called T_Model which will store all the
>>>>> attribute in
>>>>>
>>>>> Model,Netwrok and OptimizedResult.
>>>>>
>>>>> So I cannot map 3 classes into T_Model.
>>>>>
>>>>> But I am not sure if it is possible to map into DB View.
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>> Anthony
>>>>>
>>>>>
>>>>>
>>>>>> Hi Anthony,
>>>>>> I think you mean embedded but to be sure can you give a small
>>>>>> example of what you want to achieve?
>>>>>>
>>>>>> gr. Martin
>>>>>>
>>>>>> Anthony wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I have several classes in a EMF model and these classes will be
>>>>>>> mapped
>>>>>>> into ONE table . How to write the mapping file to only let one
>>>>>>> class to insert/update/delete the table record and the others
>>>>>>> just mapped to some fields?
>>>>>>>
>>>>>>> Thanks in advance!
>>>>>>>
>>>>>>>
>>>>>>> Anthony
>>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
| | |
Re: [Teneo+Hibernate]Help! A hibernate mapping question [message #606760 is a reply to message #84440] |
Tue, 22 May 2007 09:09 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Anthony,
Model refers to one instance of Network and one instance of OptimizedResult and you want the
features of Network and OptimizedResult to be mapped to the same table as Model. When a Model is
saved also the Network and OptimizedResult are saved.
Is this what you want?
gr. Martin
Anthony wrote:
> Martin,
>
> Thank you for help.
>
> I just learn to write my mapping file.
>
> It seems that when a new persistable object was saved
> a new record will be inserted into its mapped table.
>
> In my case, the sample structure of my EMF model list below:
>
> Model
> |____Network
> |
> |____OptimizedResult
>
>
> There is a table called T_Model which will store all the attribute in
>
> Model,Netwrok and OptimizedResult.
>
> So I cannot map 3 classes into T_Model.
>
> But I am not sure if it is possible to map into DB View.
>
>
> Regards,
>
> Anthony
>
>
>
>> Hi Anthony,
>> I think you mean embedded but to be sure can you give a small example
>> of what you want to achieve?
>>
>> gr. Martin
>>
>> Anthony wrote:
>>> Hi,
>>>
>>> I have several classes in a EMF model and these classes will be
>>> mapped
>>> into ONE table . How to write the mapping file to only let one class
>>> to insert/update/delete the table record and the others just mapped
>>> to some fields?
>>>
>>> Thanks in advance!
>>>
>>>
>>> Anthony
>>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
| |
Re: [Teneo+Hibernate]Help! A hibernate mapping question [message #606762 is a reply to message #84465] |
Tue, 22 May 2007 09:21 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Anthony,
To achieve this you can set the @Embedded annotation in the ereferences Model.Network and
Model.OptimizedResult.
If there are nameclashes between Network, OptimizedResult and Model then you can use
@AttributeOverrides.
gr. Martin
Anthony wrote:
> Martin,
>
> Exactly.
>
>
> Anthony
>
>> Anthony,
>> Model refers to one instance of Network and one instance of
>> OptimizedResult and you want the features of Network and
>> OptimizedResult to be mapped to the same table as Model. When a Model
>> is saved also the Network and OptimizedResult are saved.
>> Is this what you want?
>>
>> gr. Martin
>>
>> Anthony wrote:
>>> Martin,
>>>
>>> Thank you for help.
>>>
>>> I just learn to write my mapping file.
>>>
>>> It seems that when a new persistable object was saved
>>> a new record will be inserted into its mapped table.
>>>
>>> In my case, the sample structure of my EMF model list below:
>>>
>>> Model
>>> |____Network
>>> |
>>> |____OptimizedResult
>>>
>>>
>>> There is a table called T_Model which will store all the attribute
>>> in
>>>
>>> Model,Netwrok and OptimizedResult.
>>>
>>> So I cannot map 3 classes into T_Model.
>>>
>>> But I am not sure if it is possible to map into DB View.
>>>
>>>
>>> Regards,
>>>
>>> Anthony
>>>
>>>
>>>
>>>> Hi Anthony,
>>>> I think you mean embedded but to be sure can you give a small
>>>> example of what you want to achieve?
>>>>
>>>> gr. Martin
>>>>
>>>> Anthony wrote:
>>>>> Hi,
>>>>>
>>>>> I have several classes in a EMF model and these classes will be
>>>>> mapped
>>>>> into ONE table . How to write the mapping file to only let one
>>>>> class to insert/update/delete the table record and the others just
>>>>> mapped to some fields?
>>>>>
>>>>> Thanks in advance!
>>>>>
>>>>>
>>>>> Anthony
>>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: [Teneo+Hibernate]Help! A hibernate mapping question [message #606763 is a reply to message #84479] |
Tue, 22 May 2007 10:02 |
Anthony Lee Messages: 114 Registered: July 2009 |
Senior Member |
|
|
Martin,
OK. I will try it.
I have another question :
In my case ,the model structure list as below:
Network
|________ProductCatalog
| |_______Product collection
|
|________CustomerCatlog
|_______Customer collection
When UI want to show product collections,
the ProductCatalog object will act as collection's
parent object to avoid getting customer collecitons.
(If no ***catalog, ContentProvider will return Network's children)
Do I have to have table to mapped ***Catalog class?
Anthony
> Anthony,
> To achieve this you can set the @Embedded annotation in the
> ereferences Model.Network and Model.OptimizedResult.
>
> If there are nameclashes between Network, OptimizedResult and Model
> then you can use @AttributeOverrides.
>
> gr. Martin
>
> Anthony wrote:
>> Martin,
>>
>> Exactly.
>>
>>
>> Anthony
>>
>>> Anthony,
>>> Model refers to one instance of Network and one instance of
>>> OptimizedResult and you want the features of Network and
>>> OptimizedResult to be mapped to the same table as Model. When a
>>> Model is saved also the Network and OptimizedResult are saved.
>>> Is this what you want?
>>>
>>> gr. Martin
>>>
>>> Anthony wrote:
>>>> Martin,
>>>>
>>>> Thank you for help.
>>>>
>>>> I just learn to write my mapping file.
>>>>
>>>> It seems that when a new persistable object was saved
>>>> a new record will be inserted into its mapped table.
>>>>
>>>> In my case, the sample structure of my EMF model list below:
>>>>
>>>> Model
>>>> |____Network
>>>> |
>>>> |____OptimizedResult
>>>>
>>>>
>>>> There is a table called T_Model which will store all the
>>>> attribute in
>>>>
>>>> Model,Netwrok and OptimizedResult.
>>>>
>>>> So I cannot map 3 classes into T_Model.
>>>>
>>>> But I am not sure if it is possible to map into DB View.
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Anthony
>>>>
>>>>
>>>>
>>>>> Hi Anthony,
>>>>> I think you mean embedded but to be sure can you give a small
>>>>> example of what you want to achieve?
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> Anthony wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I have several classes in a EMF model and these classes will be
>>>>>> mapped
>>>>>> into ONE table . How to write the mapping file to only let one
>>>>>> class to insert/update/delete the table record and the others
>>>>>> just mapped to some fields?
>>>>>>
>>>>>> Thanks in advance!
>>>>>>
>>>>>>
>>>>>> Anthony
>>>
>>
>
>
|
|
|
Re: [Teneo+Hibernate]Help! A hibernate mapping question [message #606764 is a reply to message #84489] |
Tue, 22 May 2007 10:10 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Anthony,
You can try to set @Embedded also on Network.ProductCatalog/CustomerCatalog to get it into the same
table as Model and Network. Is that whay you want/mean?
gr. Martin
Anthony wrote:
> Martin,
>
> OK. I will try it.
>
> I have another question :
>
> In my case ,the model structure list as below:
>
> Network
> |________ProductCatalog
> | |_______Product collection
> |
> |________CustomerCatlog
> |_______Customer collection
>
>
> When UI want to show product collections,
> the ProductCatalog object will act as collection's
> parent object to avoid getting customer collecitons.
>
> (If no ***catalog, ContentProvider will return Network's children)
>
>
> Do I have to have table to mapped ***Catalog class?
>
>
> Anthony
>
>
>
>
>
>
>> Anthony,
>> To achieve this you can set the @Embedded annotation in the
>> ereferences Model.Network and Model.OptimizedResult.
>>
>> If there are nameclashes between Network, OptimizedResult and Model
>> then you can use @AttributeOverrides.
>>
>> gr. Martin
>>
>> Anthony wrote:
>>> Martin,
>>>
>>> Exactly.
>>>
>>>
>>> Anthony
>>>
>>>> Anthony,
>>>> Model refers to one instance of Network and one instance of
>>>> OptimizedResult and you want the features of Network and
>>>> OptimizedResult to be mapped to the same table as Model. When a
>>>> Model is saved also the Network and OptimizedResult are saved.
>>>> Is this what you want?
>>>>
>>>> gr. Martin
>>>>
>>>> Anthony wrote:
>>>>> Martin,
>>>>>
>>>>> Thank you for help.
>>>>>
>>>>> I just learn to write my mapping file.
>>>>>
>>>>> It seems that when a new persistable object was saved
>>>>> a new record will be inserted into its mapped table.
>>>>>
>>>>> In my case, the sample structure of my EMF model list below:
>>>>>
>>>>> Model
>>>>> |____Network
>>>>> |
>>>>> |____OptimizedResult
>>>>>
>>>>>
>>>>> There is a table called T_Model which will store all the
>>>>> attribute in
>>>>>
>>>>> Model,Netwrok and OptimizedResult.
>>>>>
>>>>> So I cannot map 3 classes into T_Model.
>>>>>
>>>>> But I am not sure if it is possible to map into DB View.
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>> Anthony
>>>>>
>>>>>
>>>>>
>>>>>> Hi Anthony,
>>>>>> I think you mean embedded but to be sure can you give a small
>>>>>> example of what you want to achieve?
>>>>>>
>>>>>> gr. Martin
>>>>>>
>>>>>> Anthony wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I have several classes in a EMF model and these classes will be
>>>>>>> mapped
>>>>>>> into ONE table . How to write the mapping file to only let one
>>>>>>> class to insert/update/delete the table record and the others
>>>>>>> just mapped to some fields?
>>>>>>>
>>>>>>> Thanks in advance!
>>>>>>>
>>>>>>>
>>>>>>> Anthony
>>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Goto Forum:
Current Time: Wed Sep 25 10:26:34 GMT 2024
Powered by FUDForum. Page generated in 0.07600 seconds
|