Recent Posts
Archives

Posts Tagged ‘Bean’

PostHeaderIcon Short Tutorial: Migration from EJB Entity to Hibernate

Case

  • let’s consider an EJB Bean AnimalBean, linked to a table JL_Animal
  • let’s have a human understandable name for the Pojo, let’s say: Animal
  • let an EJB entity have following finders:

[java]
* @ejb.finder
* signature = "Collection findByBirthDate(java.lang.Integer birthDate)"
* query = "SELECT OBJECT(o) FROM AnimalBean AS o WHERE o.birthDate = ?1"
*
* @ejb.finder
* signature = "Collection findByCountryAndBirthDate(java.lang.String from,java.lang.Integer birthDate)"
* query = "SELECT OBJECT(o) FROM AnimalBean AS o WHERE o.country = ?1 AND o.birthDate = ?2"[/java]

Read the rest of this entry »