[hibernate-dev] [OGM-122/OGM-128] Config key to difference development and production mode

kmx.petals at gmail.com kmx.petals at gmail.com
Sun Mar 25 07:11:23 EDT 2012


Hi,

I am trying to integrate Cassandra into Hibernate OGM (cf. issue 
OGM-122) and I have some noob questions.

To use Cassandra, it is mandatory to indicate the keyspace to use and to 
switch into the right one.

As the keyspace is determining the application architecture and as it is 
difficult to know how the application has to use the keyspace, we 
decided with Emmanuel that it could be a good solution to distinct the 
development mode where the keyspace & co would be created and the 
production mode where Hibernate OGM would use an already existing keyspace.

We thought that it could be a good idea using the property 
hibernate.hbm2ddl.auto which is well known by hibernate users.
However, setting this property to create or create-drop seems to 
indicate to Hibernate core to create tables with the jdbc dialect.

If I am right, using the value create for the key hibernate.hbm2ddl.auto 
indicates to the class SchemaExport to use JdbcDialect which is not what 
is expected :

this.importFiles = ConfigurationHelper.getString(
                 AvailableSettings.HBM2DDL_IMPORT_FILES,
                 configuration.getProperties(),
                 DEFAULT_IMPORT_FILE
         );

final Dialect dialect = serviceRegistry.getService( JdbcServices.class 
).getDialect();

So, I suggest to use a different key to indicate if the development or 
production mode should be used.

What do you think about?

Cheers,

Khanh Tuong




More information about the hibernate-dev mailing list