Yes I've seen that option, but my application is not an MVC, its just pure Spring application and I need to avoid creating persistance.xml file.
My previous database.xml (which is included in application-context.xml) look like this
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.springframework.org/schema/beans" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd">
<!--Defining DataSource-->
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="org.hibernate.dialect.HSQLDialect"/>
<property name="url" value="jdbc:hsqldb:file:db/jminer"/>
<property name="username" value="sa"/>
<property name="password" value=""/>
</bean>
<!--Defining Hibernate Configurations-->
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="packagesToScan" value="com.jminer.core.persistence"/>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
<prop key="hibernate.current_session_context_class">thread</prop>
<prop key="hibernate.connection.pool_size">10</prop>
<prop key="hibernate.format_sql">true</prop>
<prop key="hibernate.cache.use_second_level_cache">false</prop>
<prop key="hibernate.cache.use_query_cache">false</prop>
<prop key="hibernate.hbm2ddl.auto">create-drop</prop>
</props>
</property>
</bean>
</beans>
I need to keep this structure, and define all my database related properties in this file... Can you help me on this?
I've tried this
<bean id="datasource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="url" value="$objectdb/db/guests.odb"/>
<property name="username" value="admin"/>
<property name="password" value="admin"/>
</bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="datasource"/>
<property name="persistenceProviderClass" value="com.objectdb.jpa.Provider"/>
</bean>
for this i need to know ObjectDB data source driver class name... If I don't understand something or missing anything here please fix me.
Also I need to have there ObjectDB specific properties
<objectdb>
<general> ... </general>
<database> ... </database>
<entities> ... </entities>
<schema> ... </schema>
<server> ... </server>
<users> ... </users>
<ssl> ... </ssl>
</objectdb>
if possible at all...