Archive for April, 2012

Difference Hibernate & JPA

Hibernate JPA
SessionFactory EntityManagerFactory
Session EntityManager
sessionFactory.getCurrentSession().[method]() entityManager.[method]()
saveOrUpdate() persist()
Query.setInteger/String/Entity() Query.setParameter()
list() getResultList()
uniqueResult() getSingleResult()
uniqueResult() returns null getSingleResult() throws NoResultException
CriteriaQueries – yes CriteriaQueries – no

Reference:
http://tech-blog.milestoneinc.com/differences-between-hibernate-and-jpa

Advertisements

,

Leave a comment

show VARIABLES in Mysql

To view the configuration of Mysql :-

show VARIABLES ;
 
Result: It will display the list of mysql configuraion.

 

Leave a comment

Difference between HashMap and Hash Table

Hash Table HashMap
It is one of the original collection classes in Java

Hashtable is synchronized

HashMap is fail-safe

HashMap permits null values

ie)one null key and any number of null values

It is part of the new Collections Framework, added in Java 2,v 1.2

HashMap isn’t

HashMap isn’t

Hashtable doesn’t permit null key or value

,

Leave a comment