Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » It is possible that I can use one entity for some tables?
It is possible that I can use one entity for some tables? [message #385998] Wed, 11 March 2009 18:16 Go to next message
Heiko Ahlig is currently offline Heiko Ahlig
Messages: 62
Registered: July 2009
Member
Hi again,
and some more newbie question.

At my project I have some constraints tables like
CON_CC, CON_STATUS ....

All this tables have the same 2 columns as
value (varchar, primary key) and descr (varchar)

And all entries of this tables ar only readable and later will be used
to build selection lists or for entries in ContentProposal's.

It is posibble to use only one class for all entries from the diffrent
tables or I have to build one class for every table?

And no I dont want take all entries in one table because than this real
big list will not be maintainable and an other application which uses
the same tables needs this constraints seperatly (and I cant change the
code from the other app :( )


And again

Thanks in advance,
Heiko
Re: It is possible that I can use one entity for some tables? [message #386003 is a reply to message #385998] Thu, 12 March 2009 08:35 Go to previous messageGo to next message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Not really.

You could define a MappedSuperclass that maps the fields, but would still
need one subclass per table to define the table.

It may also be possible to define a view on the database that unions all
the tables, and map a single class to the view.

---
James
http://www.nabble.com/EclipseLink---Users-f26658.html


James : Wiki : Book : Blog : Twitter
Re: It is possible that I can use one entity for some tables? [message #386012 is a reply to message #386003] Thu, 12 March 2009 18:12 Go to previous message
Heiko Ahlig is currently offline Heiko Ahlig
Messages: 62
Registered: July 2009
Member
Hi James,
ok I thought as much.

Argh this will be over 120 subclasses later. :(

Heiko


Am 12.03.2009 13:35, schrieb James:
> Not really.
>
> You could define a MappedSuperclass that maps the fields, but would
> still need one subclass per table to define the table.
>
> It may also be possible to define a view on the database that unions all
> the tables, and map a single class to the view.
>
> ---
> James
> http://www.nabble.com/EclipseLink---Users-f26658.html
>
>
Previous Topic:EclipseLink workbench and ManyToOne
Next Topic:Using database views
Goto Forum:
  


Current Time: Tue Jul 29 15:08:39 EDT 2014

Powered by FUDForum. Page generated in 0.04585 seconds