• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Annotations and Named Queries

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greetings all

In most of the books I've read (on Hibernate) they specify that Named Queries should be placed at the bottom of the mapping file

From Hibernate Quickly...

Named queries, not to be confused with named parameters, are queries
that are embedded in the XML mapping definition. Typically, you put
all of the queries for a given object into the same file. Centralizing your
queries in this fashion makes maintenance quite a bit easier. Named
queries are placed at the bottom of the mapping definition files:


My question is this. When attending Advanced Hibernate Training in Atlanta last week, the instructor stated, that, Annotations should be used as opposed to Mapping files, with that said, Annotations allow you to place the Named Queries and the Package or Class Level, my questions is this: what is the difference between the two, and why would you pick one over the other?

Any feedback appreciated.
 
author
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Personal taste.
 
When people don’t understand what you are doing they call you crazy. But this tiny ad just doesn't care:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic