Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF Resource extension for direct RDB/SQL(Not ORM, but direct SQL)
EMF Resource extension for direct RDB/SQL [message #529066] Thu, 22 April 2010 19:42 Go to next message
Alexey  is currently offline Alexey Friend
Messages: 36
Registered: March 2010
Member
The EMF Bible (EMF Eclipse Modeling Framework by Dave Stainberg, Frank Budinsky) mentions couple of times that EMF persistence can be implemented with RDB/SQL. Naturally, Teneo is providing that with ORM (Hibernate). But... some requirements from real life are more retarded that others. So I am looking for any precedent to extend Resourse persistence support with direct SQL. E.g., when URI.createURI(...) would accept DB URL (like jdbc:mysql://host_name:port/dbname) and eventually would use java.sql.Connection, while EMF would help to generate a content to put in java.sql.Statement (of some type).

So, are there any reasons not to do that? Problems? Did anybody try? Is this a stupid question? Why then?

Thanks

Alexey
Re: EMF Resource extension for direct RDB/SQL [message #529094 is a reply to message #529066] Thu, 22 April 2010 22:27 Go to previous message
Bryan Hunt is currently offline Bryan HuntFriend
Messages: 366
Registered: July 2009
Senior Member
This can certainly be done. There are a couple of options you can
take: you can map objects to tables where attributes and references map
to columns, or you can serialize the entire resource as a blob / clob.
Storing resources as a clob / blob is not too dificult. The easiest
approach is to craete a custom URIConverter to access the input and
output streams from the database lob. Mapping an EObject and its
EAttributes to a table is also not all that hard. When you start
supporting EReferences, that's when it gets hard. There are several
subtle problems that must be solved to have a generic solution. If you
go this route, expect to spend several months developing a solution.

Bryan

On 2010-04-22 14:42:38 -0500, Alexey <alexeyy3@gmail.com> said:

> The EMF Bible (EMF Eclipse Modeling Framework by Dave Stainberg, Frank
> Budinsky) mentions couple of times that EMF persistence can be
> implemented with RDB/SQL. Naturally, Teneo is providing that with ORM
> (Hibernate). But... some requirements from real life are more retarded
> that others. So I am looking for any precedent to extend Resourse
> persistence support with direct SQL. E.g., when URI.createURI(...)
> would accept DB URL (like jdbc:mysql://host_name:port/dbname) and
> eventually would use java.sql.Connection, while EMF would help to
> generate a content to put in java.sql.Statement (of some type).
>
> So, are there any reasons not to do that? Problems? Did anybody try? Is
> this a stupid question? Why then?
>
> Thanks
>
> Alexey
Previous Topic:how to get the root model from the ecore file
Next Topic:[Teneo] Support for overriding the column name for nested embedded objects?
Goto Forum:
  


Current Time: Tue Sep 24 13:41:06 GMT 2024

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

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

Back to the top