Useful Annotation for Model Class

In out previous post we have see how we can change the table name and the Model name using the @Entity (name=”TABLE_NAME“)  and @Column (name=”COLUMN_NAME“)   Here when we use the @Entity (name=”TABLE_NAME“) the entity name  also gets changed,so if we want to change only the table then use @Table(name=”TABLE_NAME”) suppose we…

Continue reading

Hibernate Name Annotation

Suppose we want to have a different table name to that of the model class(Default),then how to do that, @Entity (name=”USER_DETAILS“)  is the annotation used to specify the Table Name and not the default. Similarly we can have different column names also against the default names,see below code, Use @Column (name=”USER_ID”)  for…

Continue reading

Importance of hbm2ddl and show_sql

Importance of hbm2ddl and show_sql Similar posts: Hibernate Setup for Eclipse Writing Model Class and Saving Object Hibernate-Working with Collection-part 1 [@ElementCollection,@JoinTable,@JoinColumn] Hibernate-Working with Collection-part 2 [adding primary key] Proxy Objects,Eager and Lazy Fetch Types

Continue reading

Writing Model Class and Saving Object

Steps required for saving a Model  without hibernate JDBC Database configuration The Model object service method to create teh model object Database design DAO method to save the object using sql queries. When we are using hibernate lot of these are not required and it also becomes very easy so…

Continue reading

Hibernate Setup for Eclipse

Hibernate Setup for Eclipse Similar posts: Writing Model Class and Saving Object Importance of hbm2ddl and show_sql Hibernate Name Annotation Hibernate-Working with Collection-part 2 [adding primary key] Proxy Objects,Eager and Lazy Fetch Types

Continue reading

Junit interview questions

Question: What is unit testing? Answer: A complete application can be build up by integrating small-2 functional parts, such parts are called as units. It is always better to test such individual units before testing the entire application. The process of testing the functionality and working of these individual unit…

Continue reading

Spring-Interview-Preparation

Spring: (WHAT/WHEN/HOW/WHY) What is Spring? It is a lightweight, loosely coupled and integrated framework for developing enterprise applications in java. Spring Framework is built on top of two design concepts – Dependency Injection and Aspect Oriented Programming.  Why use Spring.(Features/Advantages) Whyto use spring is something more of a combination of…

Continue reading

FAQ-Linux Commands -2

The 15 Most Important UNIX commands man – show manual for a command, example: man ls hit q to exit the man page. cd – change directory, example: cd /etc/ ls – list directory, similar to dir on windows. example: ls /etc, use ls -l /etc to see more detail…

Continue reading

FAQ-Linux Commands -1

1. tar command examples Create a new tar archive. $ tar cvf archive_name.tar dirname/ Extract from an existing tar archive. $ tar xvf archive_name.tar View an existing tar archive. $ tar tvf archive_name.tar 2. grep command examples Search for a given string in a file (case in-sensitive search). $ grep…

Continue reading

Immutable-Class

Points to Remember : Declare your class as final.[public final class xxx] Set the values of properties using constructor only. Make the properties of the class final and private Do not provide any setters for these properties. If the instance fields include references to mutable objects, don’t allow those objects…

Continue reading