views:

493

answers:

3

For example, not to build queries by string manipulation, and the like.

A: 

When you consider Hibernate best practices (or those best practices), you notice they are related to Hibernate configuration (xml files), or queries.

That means your best bet is to write custom Chectyle checks.
(hence the Community Wiki status since this is not an actual direct answer)

VonC
A: 

I'm not aware of any such checks, but if you want to go that road you either have the option presented above by VonC or you might take a different path and take a look at AspectJ declare error and/or declare warning. The main difference is that using AspectJ you'll be able to impose these rules upon compilation. Anyways, if you are more familiar with PMD maybe it would be better to stay on that land.

./alex

alexpopescu
A: 

looks there are no such files...

flybywire