Skip to main content



      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
Eclipse UserFriend
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
Eclipse UserFriend
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
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
Eclipse UserFriend
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: Thu Jul 24 16:54:33 EDT 2025

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

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

Back to the top