Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » JPA/EclipseLink "abuse": table rows -> hash map?
JPA/EclipseLink "abuse": table rows -> hash map? [message #383816] Mon, 24 November 2008 09:30 Go to next message
Kristian Rink is currently offline Kristian RinkFriend
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
Re: JPA/EclipseLink "abuse": table rows -> hash map? [message #383823 is a reply to message #383816] Tue, 25 November 2008 14:30 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

I suppose this falls into the category of "dynamic persistence". We have
flirted with several such solutions to the problem domain.

Most of our current work involves generating classes dynamically, but you
may also wish to look into subclassing RelationalDescriptor, or using the
mapping's AttributeAccessor to provide some level of dynamic persistence.

There is an example under construction here:
http://wiki.eclipse.org/EclipseLink/Examples/JPA/Dynamic

You may also want to see our SDO and XR support, which may be related,

http://wiki.eclipse.org/EclipseLink/FAQ/WhatIsSDO

http://wiki.eclipse.org/EclipseLink/FAQ/WhatIsXR

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


James : Wiki : Book : Blog : Twitter
Previous Topic:@PrePersist endless loop
Next Topic:Problems with UnitOfWork
Goto Forum:
  


Current Time: Thu Apr 25 16:28:10 GMT 2024

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

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

Back to the top