Skip to main content


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 22:16 Go to next message
Heiko Ahlig is currently offline Heiko AhligFriend
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 12:35 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
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 22:12 Go to previous message
Heiko Ahlig is currently offline Heiko AhligFriend
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: Sat Apr 27 01:43:29 GMT 2024

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

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

Back to the top