Friday, 17 February 2012

What is the difference between merge and update? | Java Hibernate

update () : When the session does not contain an persistent instance with the same identifier, and if it is sure use update for the data persistence in hibernate.
merge (): Irrespective of the state of a session, if there is a need to save the modifications at any given time, use merge().

State the role of SessionFactory interface plays in Hibernate? | Java Hibernate

•    An application obtains Session instances from a SessionFactory which is typically single for the whole application created during its initialization.
•    The SessionFactory caches generate SQL statements and other mapping metadata that Hibernate uses at runtime.
•    It also holds cached data that has been read in one unit of work and may be reused in a future unit of work
SessionFactory sessionFactory = configuration.buildSessionFactory();

Explain the role of Session interface in Hibernate? Java Hibernet

•    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.

Explain the general flow of Hibernate communication with RDBMS? | Java Hibernet

The general flow of Hibernate communication with RDBMS is :
•    The Hibernate configuration is to be loaded and creation of configuration object is done. The mapping of all hbm files will be performed automatically.
•    Creation of session factory from the configuration object.
•    Obtain a session from the session factory.
•    Creation of HQL Query
•    Execution of the query in order to get the list of containing java objects.

What is Hibernate Query Language (HQL)? | Java Hibernet

Hibernate Query Language is designed for data management using Hibernate technology. It is completely object oriented and hence has notions like inheritance, polymorphism and abstraction. The queries are case-sensitive. This has an exception for Java classes and properties. The query operations are through objects. HQL acts as a bridge between Objects and RDBMS.

Thursday, 16 February 2012

How you restrict a user to cut and paste from the html page using JAVA Programing? | Java JDBC


 Using JavaScript to lock keyboard keys. It is one of easiest solutions.

What is Serialization and deserialization in JAVA Programming? | Java JDBC


Serialization is the process of writing the state of an object to a byte stream.
Deserialization is the process of restoring these objects.