HibernateConfigPlugin generates empty xml for all properties
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class"/>
<property name="hibernate.connection.url"/>
<property name="hibernate.connection.username"/>
<property name="hibernate.connection.password"/>
<property name="hibernate.connection.autocommit"/>
<property name="hibernate.connection.autoReconnect"/>
<property name="hibernate.connection.autoReconnectForPools"/>
<property name="hibernate.connection.is-connection-validation-required"/>
<property name="hibernate.connection.pool_size"/>
<property name="hibernate.jdbc.fetch_size"/>
<property name="hibernate.jdbc.batch_size"/>
<property name="hibernate.jdbc.batch_versioned_data"/>
<property name="hibernate.jdbc.use_scrollable_resultset"/>
<property name="hibernate.jdbc.use_streams_for_binary"/>
<property name="hibernate.jdbc.use_get_generated_keys"/>
<property name="hibernate.connection.isolation"/>
<property name="hibernate.cglib.use_reflection_optimizer"/>
<property name="hibernate.connection.provider_class"/>
<property name="hibernate.connection.datasource"/>
<property name="hibernate.jndi.url"/>
<property name="hibernate.jndi.class"/>
<property name="hibernate.dialect"/>
<property name="hibernate.default_schema"/>
<property name="hibernate.default_entity_mode"/>
<property name="hibernate.session_factory_name"/>
<property name="hibernate.use_outer_join"/>
<property name="hibernate.max_fetch_depth"/>
<property name="hibernate.cache.provider_class"/>
<property name="hibernate.cache.use_minimal_puts"/>
<property name="hibernate.cache.use_query_cache"/>
<property name="hibernate.cache.query_cache_factory"/>
<property name="hibernate.cache.region_prefix"/>
<property name="hibernate.transaction.factory_class"/>
<property name="jta.UserTransaction"/>
<property name="hibernate.transaction.manager_lookup_class"/>
<property name="hibernate.query.substitutions"/>
<property name="hibernate.show_sql"/>
<property name="hibernate.hbm2ddl.auto">true</property>
<property name="hibernate.c3p0.max_size"/>
<property name="hibernate.c3p0.min_size"/>
<property name="hibernate.c3p0.timeout"/>
<property name="hibernate.c3p0.max_statements"/>
<property name="hibernate.c3p0.idle_test_period"/>
<property name="hibernate.c3p0.acquire_increment"/>
<mapping resource="a/b/ABC.hbm.xml"/>
</session-factory>
</hibernate-configuration>
It seems jelly-tag:
<j:if test="${!empty(plugin.Transactionmanagerlookup)}">
fails to detect empty properties
Tried with:
<j:if test="${plugin.notEmpty(plugin.Transactionmanagerlookup)}">
public class HibernateConfigPlugin extends AbstractHibernatePlugin {
...
public boolean notEmpty(Object object) {
if (object != null) {
if (object instanceof String) {
return ((CharSequence) object).length() > 0;
}
return true;
}
return false;
}
...
}
And it generates the config correctly.
Espen