Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to use hibernate annotations?

 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

1.How to use Hibernate annotation.
2. What is Hibernate Annotation?
3. What is the important usage of annotations?
4. How to apply the annotion
5. What is the important reference URL for annotation

Thanks
 
Tim Holloway
Bartender
Posts: 18467
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This reads like a "homework assignment".

Have you considered just reading the docs on the Hibernate site? They're not that complex.
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe, but Edward hasn't asked homework assignments before, so I am easily going to assume that it is not.

To use Hibernate Annotations you just need Hibernate 3.x and Java 5.0 SDK.

Annotations are Java's way of adding the features you had originally gotten from XDoclet. They take the form of @Annotation before class definition, attributes and methods of classes. By default all you need on a class is the @Entity at the class level, and @Id on the PK field and your class is now a mapped class. By default when you put @Id all the attributes of the class are now going to be persisted.

Mark
 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Thanks for your replies

I saw one class declaration like

public class ExportBatchDaoImpl extends HibernateBaseDao<ExportBatch> implements ExportBatchDao {

in the above code what is HibernateBaseDao<ExportBatch> means?

Thanks for your reply
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!