JPA/EclipseLink "abuse": table rows -> hash map? [message #383816] |
Mon, 24 November 2008 09:30 |
Kristian Rink Messages: 64 Registered: July 2009 |
Member |
|
|
Folks;
hoping not to be kicked off-group as this question eventually is horribly
off what JPA and EclipseLink eventually tries to do, but it seems the most
usable way of handling a legacy (and rather peculiar) database structure in
one of our facilities:
In order to get data extracted out of a set of huge (both in terms of column
and row count) tables, I so far am evaluating several different approaches,
and the one which seems most usable to me (looking at our migration efforts
and looking at how the data in question is about to be used in external
systems anyhow) is something like this:
class DbEntity {
private String sourceTableName="";
private Map<String,String> sourceTableAttributes;
[...]
}
What I would like to do is "abusing" JPA/EclipseLink to, given several
database (SQL) requests,
- fill "sourceTableName" with the name of a certain table these information
are about to be retrieved from (or a sane combination of both given a join
of some sort),
- fill the "sourceTableAttributes" to pairs of "table-column-name"/
"table-column-value" for each of the objects retrieved from the database.
Actually I wouldn't really need JPA/EclipseLink for this, the only reason
why I eventually would want to throw it in here is the superiour caching
facility provided by EclipseLink which I would like using for that instead
of having to re-implement database caching on my own. So to ask: Can
something like this be done with JPA/EclipseLink, or am I better off doing
it manually altogether?
Thanks in advance (for your patience, as well),
Kristian
|
|
|
|
Powered by
FUDForum. Page generated in 0.03566 seconds