Quick Note – Creating ad hoc Relations with the Hibernate Query Language

When using an ORM tool such as Hibernate, relations between multiple entities are typically resolved directly by means of associations, which are defined within your metadata that will map the entities classes to the underlying persistence unit. Inside your classes, those associations are usually represented as fields (or properties) which reference either a single related entity or a whole collection of related entities.
As long as only one of the related entities holds a reference to the other one, we have an association which is unidirectional – this may be the most usual style in practice. Read the rest of this entry »