Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Can Teneo start from the database schema as a model?
Can Teneo start from the database schema as a model? [message #88551] Sun, 08 July 2007 18:03 Go to next message
Eclipse UserFriend
Originally posted by: akarypid.yahoo.gr

Hi,

I went through the Hibernate tutorial at elver.org and was pretty
impressed with Teneo. However, what I need is a tool like Teneo, which
will start from the database schema and go all the way to creating the
editor.

For instance, assuming I have this table:

CREATE TABLE SUPPLIER (
SUPPLIER_ID INTEGER GENERATED BY DEFAULT AS IDENTITY,
TITLE VARCHAR(50),
PRIMARY KEY (SUPPLIER_ID)
);


It'd be nice if Teneo could use Hibernate to create a mapped class
"Supplier", and EMF model out of that and then an EditorPart for it.

Perhaps this can already be achieved with Teneo, but is just not documented?

Or perhaps there are plans to add such support in the future?
Re: Can Teneo start from the database schema as a model? [message #88566 is a reply to message #88551] Sun, 08 July 2007 20:05 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Alexandros,
It is really a nice idea but it is not supported and I have nothing planned for this in the
short/mid-term future (like 6 months).

I think what would be required is a hbm (or schema) to ecore converter (instead of the other way
around as Teneo does now). From the ecore model file the model and editor code can be generated.

This would be a few weeks work to develop but I do not have the time to do this I am afraid (just
not enough hours in a day)....

gr. Martin

Alexandros Karypidis wrote:
> Hi,
>
> I went through the Hibernate tutorial at elver.org and was pretty
> impressed with Teneo. However, what I need is a tool like Teneo, which
> will start from the database schema and go all the way to creating the
> editor.
>
> For instance, assuming I have this table:
>
> CREATE TABLE SUPPLIER (
> SUPPLIER_ID INTEGER GENERATED BY DEFAULT AS IDENTITY,
> TITLE VARCHAR(50),
> PRIMARY KEY (SUPPLIER_ID)
> );
>
>
> It'd be nice if Teneo could use Hibernate to create a mapped class
> "Supplier", and EMF model out of that and then an EditorPart for it.
>
> Perhaps this can already be achieved with Teneo, but is just not
> documented?
>
> Or perhaps there are plans to add such support in the future?


--

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: Can Teneo start from the database schema as a model? [message #88579 is a reply to message #88566] Sun, 08 July 2007 20:21 Go to previous message
Eclipse UserFriend
Originally posted by: akarypid.yahoo.gr

Hi Martin,

I'm playing around this weekend with Eclipse stuff. I'm thinking I might
take this up, because right after I sent this e-mail, I started writing
such an EditorPart.

What I do is:

1) I used generics to create a DBEditorPart<T>, DBTableLabelViewer<T>
and a DBContentProvider<T>, where T is presumably a persistent type. I
use reflection to isolate public methods, starting with "get" and taking
no parameters in class T:
public <O> getXXXX();
I set up a column for each of these methods.

2) DBContentProvider<T> uses JPA (I currently use Toplink Essentials,
not Hibernate, but should be able to work with both) to fetch objects
from the persistent store. You need to provide a Query object that will
fetch the rows (I create a <T>[] array using getRsultsList()).

3) DBTableLabelProvider<T> uses reflection to invoke the respective
getter for each column and return a String.

Works like a charm but doesn't use EMF (I don't have much experience
with it yet). I'm currently implementing lazy fetching using
setFirstResult() / setMaxResults() so that the rows are fetched
on-demand when using SWT.VIRTUAL. I added a second "count" query that
allows one to count the number of rows returned.

Would you be interested in such a contribution? It'll take a while for
me to get up to speed with EMF and Teneo (so that I may integrate this
properly in EMFT) but the rapid prototype took me just a few hours, so...

Cheers!

Martin Taal wrote:

> Hi Alexandros,
> It is really a nice idea but it is not supported and I have nothing
> planned for this in the short/mid-term future (like 6 months).
>
> I think what would be required is a hbm (or schema) to ecore converter
> (instead of the other way around as Teneo does now). From the ecore
> model file the model and editor code can be generated.
>
> This would be a few weeks work to develop but I do not have the time to
> do this I am afraid (just not enough hours in a day)....
>
> gr. Martin
>
> Alexandros Karypidis wrote:
>> Hi,
>>
>> I went through the Hibernate tutorial at elver.org and was pretty
>> impressed with Teneo. However, what I need is a tool like Teneo, which
>> will start from the database schema and go all the way to creating the
>> editor.
>>
>> For instance, assuming I have this table:
>>
>> CREATE TABLE SUPPLIER (
>> SUPPLIER_ID INTEGER GENERATED BY DEFAULT AS IDENTITY,
>> TITLE VARCHAR(50),
>> PRIMARY KEY (SUPPLIER_ID)
>> );
>>
>>
>> It'd be nice if Teneo could use Hibernate to create a mapped class
>> "Supplier", and EMF model out of that and then an EditorPart for it.
>>
>> Perhaps this can already be achieved with Teneo, but is just not
>> documented?
>>
>> Or perhaps there are plans to add such support in the future?
>
>
Re: Can Teneo start from the database schema as a model? [message #608669 is a reply to message #88551] Sun, 08 July 2007 20:05 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Alexandros,
It is really a nice idea but it is not supported and I have nothing planned for this in the
short/mid-term future (like 6 months).

I think what would be required is a hbm (or schema) to ecore converter (instead of the other way
around as Teneo does now). From the ecore model file the model and editor code can be generated.

This would be a few weeks work to develop but I do not have the time to do this I am afraid (just
not enough hours in a day)....

gr. Martin

Alexandros Karypidis wrote:
> Hi,
>
> I went through the Hibernate tutorial at elver.org and was pretty
> impressed with Teneo. However, what I need is a tool like Teneo, which
> will start from the database schema and go all the way to creating the
> editor.
>
> For instance, assuming I have this table:
>
> CREATE TABLE SUPPLIER (
> SUPPLIER_ID INTEGER GENERATED BY DEFAULT AS IDENTITY,
> TITLE VARCHAR(50),
> PRIMARY KEY (SUPPLIER_ID)
> );
>
>
> It'd be nice if Teneo could use Hibernate to create a mapped class
> "Supplier", and EMF model out of that and then an EditorPart for it.
>
> Perhaps this can already be achieved with Teneo, but is just not
> documented?
>
> Or perhaps there are plans to add such support in the future?


--

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: Can Teneo start from the database schema as a model? [message #608670 is a reply to message #88566] Sun, 08 July 2007 20:21 Go to previous message
Alex Mising name is currently offline Alex Mising nameFriend
Messages: 148
Registered: March 2010
Senior Member
Hi Martin,

I'm playing around this weekend with Eclipse stuff. I'm thinking I might
take this up, because right after I sent this e-mail, I started writing
such an EditorPart.

What I do is:

1) I used generics to create a DBEditorPart<T>, DBTableLabelViewer<T>
and a DBContentProvider<T>, where T is presumably a persistent type. I
use reflection to isolate public methods, starting with "get" and taking
no parameters in class T:
public <O> getXXXX();
I set up a column for each of these methods.

2) DBContentProvider<T> uses JPA (I currently use Toplink Essentials,
not Hibernate, but should be able to work with both) to fetch objects
from the persistent store. You need to provide a Query object that will
fetch the rows (I create a <T>[] array using getRsultsList()).

3) DBTableLabelProvider<T> uses reflection to invoke the respective
getter for each column and return a String.

Works like a charm but doesn't use EMF (I don't have much experience
with it yet). I'm currently implementing lazy fetching using
setFirstResult() / setMaxResults() so that the rows are fetched
on-demand when using SWT.VIRTUAL. I added a second "count" query that
allows one to count the number of rows returned.

Would you be interested in such a contribution? It'll take a while for
me to get up to speed with EMF and Teneo (so that I may integrate this
properly in EMFT) but the rapid prototype took me just a few hours, so...

Cheers!

Martin Taal wrote:

> Hi Alexandros,
> It is really a nice idea but it is not supported and I have nothing
> planned for this in the short/mid-term future (like 6 months).
>
> I think what would be required is a hbm (or schema) to ecore converter
> (instead of the other way around as Teneo does now). From the ecore
> model file the model and editor code can be generated.
>
> This would be a few weeks work to develop but I do not have the time to
> do this I am afraid (just not enough hours in a day)....
>
> gr. Martin
>
> Alexandros Karypidis wrote:
>> Hi,
>>
>> I went through the Hibernate tutorial at elver.org and was pretty
>> impressed with Teneo. However, what I need is a tool like Teneo, which
>> will start from the database schema and go all the way to creating the
>> editor.
>>
>> For instance, assuming I have this table:
>>
>> CREATE TABLE SUPPLIER (
>> SUPPLIER_ID INTEGER GENERATED BY DEFAULT AS IDENTITY,
>> TITLE VARCHAR(50),
>> PRIMARY KEY (SUPPLIER_ID)
>> );
>>
>>
>> It'd be nice if Teneo could use Hibernate to create a mapped class
>> "Supplier", and EMF model out of that and then an EditorPart for it.
>>
>> Perhaps this can already be achieved with Teneo, but is just not
>> documented?
>>
>> Or perhaps there are plans to add such support in the future?
>
>
Previous Topic:Can Teneo start from the database schema as a model?
Next Topic:[Teneo] ClassCastException from hibernate trying to persist a new EMap entry.
Goto Forum:
  


Current Time: Thu Oct 06 07:50:59 GMT 2022

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

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

Back to the top