Showing posts with label Interface. Show all posts
Showing posts with label Interface. Show all posts

Thursday, 15 December 2011

Java interview questions: - In hibernate framework explain the core interfaces of it?

This is one of the most favorite  Java interview questions of the interviewer. So in the following way one can answer this question: -

Session Interface
This is the primary interface used by hibernate applications
The instances of this interface are lightweight and are inexpensive to create and destroy
Hibernate sessions are not thread safe

Session Factory Interface
This is a factory that delivers the session objects to hibernate application.

Configuration Interface
This interface is used to configure and bootstrap hibernate.
The instance of this interface is used by the application in order to specify the location of hbm documents

Transaction Interface
This interface abstracts the code from any kind of transaction implementations such as JDBC transaction, JTA transaction

Query and Criteria Interface
This interface allows the user to perform queries and also control the flow of the query execution

Following is the video where it is shown practically to implement Many To One relation in database using Hibernate: -



Click and get to see more on  Java/J2EE interview questions series.

Regards,

Also visit author’s blog for more Java/J2EE interview questions

Saturday, 12 November 2011

Java interview questions: - What are the functions present in Queue interface?

This is one of the typically asked  Java interview questions in most of the Java interview.
  • public boolean offer(Object element): return false if the object cannot be added to the collection due to size issue and without throwing unchecked exception.
  • public Object remove(): behaves like the Collection interface version.
  • public Object poll(): behaves just like remove() but when invoked on empty collection returns null without throwing exception.
  • public Object element(): for querying the element at the head of the queue. Throws exception when a collection is empty.
  • public Object peek(): for querying the element at the head of the queue. Returns null if the collection is empty.
Also see Batch Processing video in Hibernate of  Java interview questions



Visit for more  Java/J2EE interview questions series.

Regards,

Also visit author’s blog for more Java/J2EE interview questions