Tag Archives: orm

JPA + ObjectDB example

JPA stands for "Java Persistence API" – an API that tries to replace direct Hibernate (or other ORM) usage with more generic layer that allows to replace underlying ORM with no application code changes. Although ORM (object relational mappers) typically … Continue reading

Posted in en | Tagged , , | Leave a comment

How To Migrate Django To Different Database Backend

Changing database location is simple – just launch dump on source database server, import it into destination database, redirect domain and voila! You can use this method to migrate your database into newer database engine version. But what can you … Continue reading

Posted in en | Tagged , , | 1 Comment

Second Level Cache For SQL Queries Under Hibernate

Second level cache in Hibernate allows to greatly speed-up your application by minimizing number of SQL queries issued and serving some results from in-memory cache (with optional disk storage or distributed cache). You have option to plug in different cache … Continue reading

Posted in en | Tagged , , , , , | Leave a comment

How To Debug Hibernate SQL Queries With Parameters

I bet everyone knows how to enable SQL logging for Hibernate. If you add this parametr to Hibernate configuration: <property name="hibernate.show_sql">true</property> you will see queries like this in log file: select roles0_.EntityKey as Entity9_1_, roles0_.ENTITYKEY as ENTITY9_168_0_ from USERROLE roles0_ … Continue reading

Posted in en | Tagged , , , | 5 Comments

org.hibernate.PropertyAccessException: exception setting property value with CGLIB

The error org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of XYZ.setStatus(). Cause Using primitive types (long) where NULL is possible or using wrong type (i.e. String if "char" is declared in HBM file). Resolution … Continue reading

Posted in en | Tagged , , , | Leave a comment