• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

new to Hibernate DAO

 
hari ann
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am learning Hibernate DAO. I am reading one tutorial. I am having the following question please help on this

public interface Dao<T>

{

int create(T obj);
void deleteById(int id);
T getById(int id);

}


What T means? for what purpose we can use T
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It represents a generic type. Read on about generics. It was introduced along with Java 1.5 some years ago. Here's a nice tutorial about that: http://java.sun.com/docs/books/tutorial/java/generics/index.html

That said, this has in fact nothing to do with Hibernate, nor with the DAO pattern. Hibernate is just an ORM framework and the DAO pattern just makes data access abstract and modular.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic