JPA, and for that matter Hibernate, depends on identifying entity instances (I'll refer to them as entities for short) by some key. That key can either be a single property (like a numeric ID column in the corresponding table) or a business key (also referred to as natural key). Business keys are entity properties which … Continue reading On JPA identifiers and business keys (or why business keys are a bad idea)
Tag: programming
Spring @Value and resolving property names with dots
I'm moving a legacy application (I seem to be doing that a lot recently) to Spring and injecting properties with @Value into Spring managed beans all over the place. And it doesn't work: public class SomeService{ @Value("#{the.org.namespace.someProperty}") private String someProperty; } Dots have apparently a special meaning, so this fails with a message that 'the' … Continue reading Spring @Value and resolving property names with dots
Note to self: how to post on facebook as a page
How to obtain a long-term access token for a page and programmaticaly post to it: From here: http://stackoverflow.com/questions/8231877/facebook-access-token-for-pages Go to the Graph API Explorer Choose your app from the dropdown menu Click "Get Access Token" Choose the manage_pages permission (you may need the user_events permission too, not sure) Now access the me/accounts connection and copy … Continue reading Note to self: how to post on facebook as a page
logging container-managed datasource jdbc with log4jdbc
In my new 'old' project which I just inherited there is - once more - Hibernate and plain JDBC access to a database, happily mixed. Hibernate logs SQL nicely, but that leaves out whatever datbase access the rest of the application is performing. I found log4jdbc very convenient which allows fain-grained logging over every interaction … Continue reading logging container-managed datasource jdbc with log4jdbc
JPA and postgres transaction isolation
The short story: the default Postgres transaction isolation level can lead to trouble in a web application. I'm showing here a way to change it in a Spring/JPA application. The long story: One of the applications I worked recently on consists of a rich client which issues an HTTP request for every little thing it … Continue reading JPA and postgres transaction isolation