Sunday, March 22, 2015

Hibernate lazy fetch true/false



lazy=false means hibernate will load the objects entities all at once. 

Means it  loads parent records and child records as well in single query. 



lazy=true means hibernate will load the objects whenever they are needed, i.e. any particular entity object will be loaded when that entity object is referenced from your application.


Means it loads only parent records (primary key records) only and its recommended for memory optimizations

Sunday, March 8, 2015

ECLIPSE “CANNOT BE RESOLVED TO A TYPE” ERROR




Try this


Windows–>Preferences–>Java–>Compiler–>Building–>Output folder–>”Rebuild class files modified by others”.

Friday, March 6, 2015

ClassNotFoundException vs NoClassDefFoundError





ClassNotFoundException
NoClassDefFoundError
Thrown when an application tries to load in a class through its name, but no definition for the class with the specified name could be found

Thrown if the JVM tries to load in the definition of a class and no definition of the class could be found.
It occurs when class loader could not find the required class in class path.

So, basically you should check your class path and add the class in the classpath.
This is more difficult to debug and find the reason.

This is thrown when at compile time the required classes are present, but at run time the classes are changed or removed or class's static initializes threw exceptions.

It means the class which is getting loaded is present in classpath, but one of the classes which are required by this class, are either removed or failed to load by compiler.

So you should see the classes which are dependent on this class .