pmd

XPath examples – Hibernate java mapping

Those who use hibernate for database access know that you need to provide an information that this object is a hibernate object. To do so you typically need to annotate your object with @Entity. It’s not a problem although if we speak about some large system. In large systems we have typically a number of instances of the same object that represent the same table in different contexts and packages. And here we need this: to give each object unique name.
Example:

XPath – how to create a custom rule

After I began to use PMD and tried to write my first custom XPath rules, I realised that there aren’t very much information about it. So I needed to figure out almost everything by myself. Here I’ll try to explain what I’ve figured out.