Posts

Showing posts from 2017

Java Interview Question

1.Can we access instance variables within static methods ? 2.Difference between shallow cloning and deep cloning of objects? 3.What happens if one of the members in a class does not implement Serializable interface?   4.How garbage collector knows that the object is not in use and needs to be removed? 5.What is daemon thread?    6.What is the difference between a REST web service and a SOAP web service?   7. Difference between @Secured vs @RolesAllowed vs @PreAuthorize in Spring Security? 8.Explain the RowCallbackHandler in Spring?   9.What are the differences between forward() and sendRedirect() methods in Servlet?   10.How to execute stored procedure in hibernate 11.Write a Java program to remove duplicate elements from an arraylist without using collections (without using set) 12.Write a program to convert a string array to arraylist? 13.Write a program for Bubble Sort in java. 14.Write a program to g...

JPA JPQL advantages and disadvantage

Image
wrong side with this JPQL query content belongs to ibm developer site highly thanks to them for basic and detailed explanation- https://www.ibm.com/developerworks/library/j-typesafejpa/ The Java developer community has welcomed JPA since its introduction in 2006. The next major update of the specification — version 2.0 (JSR 317) — will be finalized later in 2009 (see  Resources ). One of the key features introduced in JPA 2.0 is the Criteria API, which brings a unique capability to the Java language: a way to develop queries that a Java compiler can verify for correctness at compile time. The Criteria API also includes mechanisms for building queries dynamically at run time. This article introduces the Criteria API and the closely associated  metamodel  concept. You will learn how to use the Criteria API to develop queries that a Java compiler can check for correctness to reduce run-time errors, in contrast to string-based Java Persistence Query Language (JPQ...