Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [TENEO] Support for Dynamic-Update Attribute(Support for Dynamic-Update Attribute)
[TENEO] Support for Dynamic-Update Attribute [message #1037179] Tue, 09 April 2013 08:48 Go to next message
Kenny Lee is currently offline Kenny Lee
Messages: 39
Registered: September 2012
Member
Hi guys,

Do you know if Teneo supports configuring attributes for dynamic-update.

"The dynamic-update attribute tells Hibernate whether to include unmodified properties in the SQL UPDATE statement."

http://www.mkyong.com/hibernate/hibernate-dynamic-update-attribute-example/
Re: [TENEO] Support for Dynamic-Update Attribute [message #1037207 is a reply to message #1037179] Tue, 09 April 2013 09:38 Go to previous messageGo to next message
Josh A is currently offline Josh A
Messages: 13
Registered: September 2012
Junior Member
I haven't used it personally, but the HbEntity Annotation in Teneo seems to have a dynamicUpdate attribute.. Does @HbEntity(dynamicUpdate="true") work?

Thanks,
Josh
Re: [TENEO] Support for Dynamic-Update Attribute [message #1037811 is a reply to message #1037207] Wed, 10 April 2013 03:14 Go to previous messageGo to next message
Kenny Lee is currently offline Kenny Lee
Messages: 39
Registered: September 2012
Member
Our models are generated dynamically. So there is no way to put the annotation beforehand.

I wonder if other than annotations, can we use any Teneo configuration to achieve this dynamicUpdate during HBM file generation.
Re: [TENEO] Support for Dynamic-Update Attribute [message #1038028 is a reply to message #1037811] Wed, 10 April 2013 10:01 Go to previous message
Martin Taal is currently offline Martin Taal
Messages: 5339
Registered: July 2009
Senior Member
Hi Kenny,
In this case I guess you can also generate annotations inside the model.
If that does not work then you can replace the EntityMapper class used by teneo to generate an class tag in the hbm.
Override this class with your own implementation, override one of the protected methods for example processFeatures
Inside this method do something like this:

getHbmContext().getCurrent().setAttribute("dynamic-update", "true");
super.processFeatures();

I typed this directly here, so check the exact contents of getHbmContext().getCurrent(), if it is indeed the tag you
want and also if dynamic-update is correct.

To tell Teneo to use your specific EntityMapper check out this wiki page:
http://wiki.eclipse.org/Teneo/Hibernate/Extensions

gr. Martin

On 04/10/2013 05:14 AM, Kenny Lee wrote:
> Our models are generated dynamically. So there is no way to put the annotation beforehand.
>
> I wonder if other than annotations, can we use any Teneo configuration to achieve this dynamicUpdate during HBM file
> generation.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:removing dyn. contributed items from a menu.
Next Topic:EMF EList & Database (Hibernate) loading problem
Goto Forum:
  


Current Time: Thu Oct 30 14:30:19 GMT 2014

Powered by FUDForum. Page generated in 0.03609 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software