Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » TENEO JPA Annotation - create a view
TENEO JPA Annotation - create a view [message #416453] Fri, 01 February 2008 13:37 Go to next message
Yigal Spinner is currently offline Yigal SpinnerFriend
Messages: 127
Registered: July 2009
Senior Member
I'm using TENEO + hibernate to persist my data and do queries.
So far I was able to cover all my needs by applying JPA annotation in
the eCore and generate the mapping file directly with TENEO.

Do you know if the TENEO annotation supporting creating view instead of
tables (in the mapping file)?
If it doesn't what would be the best way to map the class to a view in a
database.

Thanks
Yigal
Re: TENEO JPA Annotation - create a view [message #416460 is a reply to message #416453] Fri, 01 February 2008 18:07 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Yigal,
Teneo questions are answered on the EMFT newsgroup (I cross-posted there).

Regarding your question:
http://www.hibernate.org/116.html#A27

So if you add a @Table(name='myviewname') it should work.

gr. Martin

Yigal wrote:
> I'm using TENEO + hibernate to persist my data and do queries.
> So far I was able to cover all my needs by applying JPA annotation in
> the eCore and generate the mapping file directly with TENEO.
>
> Do you know if the TENEO annotation supporting creating view instead of
> tables (in the mapping file)?
> If it doesn't what would be the best way to map the class to a view in a
> database.
>
> Thanks
> Yigal


--

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 JPA Annotation - create a view [message #1121627 is a reply to message #416460] Mon, 30 September 2013 20:37 Go to previous messageGo to next message
M B is currently offline M BFriend
Messages: 5
Registered: February 2013
Junior Member
I try to create the database view with following annotations in ecore-file:

@HbEntity
@Subselect("select E_ID from `test`")
@Table(name="TEST_VIEW").

I have an error: org.eclipse.emf.teneo.annotations.parser.AnnotationParserException: No eclass found with name Subselect.
I think that it is normally, there is no @Subselect in support annotations of Teneo.

Which combination of annotation should I use? Please give one example.
Thanks in advance!
Re: TENEO JPA Annotation - create a view [message #1121725 is a reply to message #1121627] Mon, 30 September 2013 22:56 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi MB,
The subselect annotation is not supported by Teneo. You can add a bugzilla to request for it (together with the
synchronize annotation). I hope to spend some time on Teneo this week to solve several open issues.

In the meantime, you can also create a database view directly in the database and then use it as a table in hibernate.

gr. Martin

On 09/30/2013 10:37 PM, M B wrote:
> I try to create the database view with following annotations in ecore-file:
>
> @HbEntity
> @Subselect("select E_ID from `test`")
> @Table(name="TEST_VIEW").
>
> I have an error: org.eclipse.emf.teneo.annotations.parser.AnnotationParserException: No eclass found with name Subselect.
> I think that it is normally, there is no @Subselect in support annotations of Teneo.
>
> Which combination of annotation should I use? Please give one example.
> Thanks in advance!
>


--

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:strange exception moving EMF based application from Helios to Kepler
Next Topic:[CDO/Net4j] Sound check if TCPAcceptor could have been activated
Goto Forum:
  


Current Time: Tue Apr 23 13:02:52 GMT 2024

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

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

Back to the top