|
Wednesday 31 October 2012
What are different types of inner classes? Nested -level classes, Member classes, Local classes, Anonymous classes. Explain them
What is a “dirty read”?
What are the main advantages of ORM like hibernate?
Other performance related optimizations that hibernate performs are:
- Caching objects
- Executing SQL statements later, when needed
- Never updating unmodified objects
- Efficient Collection Handling
- Rolling two updates into one
- Updating only the modified columns
- Outer join fetching
- Lazy collection initialization
- Lazy object initialization
Explain the role of Session interface in Hibernate.
- In hibernate, the Session interface wraps a JDBC connection, holds a mandatory (first-level) cache of persistent objects, used when navigating the object graph or looking up objects by identifier and is a factory for Transaction
- Session session = sessionFactory.openSession();
- The Session interface is the primary interface used by Hibernate applications.
- It is a single-threaded, short-lived object representing a conversation between the application and the persistent store.
- It allows you to create query objects to retrieve persistent objects.
What are Collection types in Hibernate?
- ArrayType,
Constructor: ArrayType(String role, String propertyRef, Class elementClass, boolean isEmbeddedInXML) - BagType,
Constructor: BagType(String role, String propertyRef, boolean isEmbeddedInXML) - CustomCollectionType, A custom type for mapping user-written
classes that implement PersistentCollection
Constructor: CustomCollectionType(Class userTypeClass, String role, String foreignKeyPropertyName, boolean isEmbeddedInXML) - IdentifierBagType,
Constructor: IdentifierBagType(String role, String propertyRef, boolean isEmbeddedInXML) - ListType,
Constructor: ListType(String role, String propertyRef, boolean isEmbeddedInXML) - MapType,
Constructor: MapType(String role, String propertyRef, boolean isEmbeddedInXML) - SetType
Constructor: SetType(String role, String propertyRef, boolean isEmbeddedInXML)
What is the difference between merge and update?
What is Hibernate proxy ?
Mapping of classes can be made into a proxy
instead of a table. A proxy is returned when actually a load is
called on a session. The proxy contains actual method to load the
data. The proxy is created by default by Hibernate, for mapping a
class to a file. The code to invoke Jdbc is contained in this
class.
Subscribe to:
Posts (Atom)
What is Map Collection?
A map collection refers to a set of maps that are compiled and organized for a specific purpose, such as research, education, or preservatio...
-
1) String is immutable while StringBuffer and StringBuilder is mutable object. 2) StringBuffer is synchronized while StringBuilder i...
-
#1 business planning solution LivePlan makes it easy to create a professional business plan that will wow any audience. ...
-
# include <stdio.h> # include <conio.h> void main() { long n, a[10], i, c = 0 ; clrscr() ; printf("Enter a number : ...