I am investigating this because I am also looking to plug OrientDB under 
Hibernate. It's not really meant for this, but the application me and my 
coworkers are building has other open source components using Hibernate. We 
could use a separate H2 database, but prefer keeping all data into one 
database. Imagine a backup software failing to backup the h2 because of a 
file lock, thus having an older version of the h2 db than the orient db. 
This would be disastrous. Also backing up 1 db first and another one later 
could also result in one db having more records than the other. Also 
quite disastrous if one were to restore this backup.
I am investigating two ways:
- Creating a OrientDBDialect.java
This can't be done without serious changes on the Orient side. First of 
all, the JDBC driver does not give any schema info which may block 
Hibernate's DDL auto feature.
Furthermore, the CREATE CLASS should support SQL style column definitions. 
For instance the table generation routine in Hibernate is like this:
new StringBuilder()
.append( dialect.getCreateTableString() )
.append( ' ' )
.append( tableName )
.append( " ( " )
.append( segmentColumnName )
.append( ' ' )
.append( dialect.getTypeName( Types.VARCHAR, segmentValueLength, 0, 0 ) )
.append( " not null " )
.append( ",  " )
.append( valueColumnName )
.append( ' ' )
.append( dialect.getTypeName( Types.BIGINT ) )
.append( ", primary key ( " )
.append( segmentColumnName )
.append( " ) ) " )
.toString()
In the dialect you can change all variables, but not the whole structure. 
Now I did not even look into the joins part yet. This option seems 
problematic.

- Creating an adapter between the OrientDB API and the Hibernate interfaces
I still have to look into this. It's a big hack, but may be easier than 
option 1. Most work will be reimplementing the Hibernate Criteria API. In 
here there could also be problems similar to the create table issue.

If anyone has any good ideas I could use them

On Thursday, May 10, 2012 7:18:29 PM UTC+2, David Williams wrote:
>
> How trivial, at this point, would it be to get this working with a 
> Hibernate dialect // with Spring-Hibernate?  
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to