Difference between Transient, Persistent, and Detached Objects in Hibernate

In Hibernate framework, an entity can be in three states, transient, persistent, and detached. When an object is in transient state, it is commonly refereed as transient object, similarly if it is in persistence and detached state, it is known as persistent and detached object. When an entity is first created using the new operator e.g. new User() and not associated with Hibernate session e.g. you haven't called session.save(user) method then it is known as transient object. At this stage, Hibernate doesn't know anything about this object and the object doesn't have any representation in database e.g. a corresponding row in the User table. Hibernate will not run any SQL query to reflect any changes on this object. You can move this object into persistent state by associating it with an hibernate session e.g. by calling save() or saveOrUpdate() method from an hibernate Session.

Top 5 FREE eBooks to Learn jQuery Online or download PDF

Everybody loves free resources, don't you? Well, I do and that's why I am always in search of good free resources e.g. eBooks and training courses. In the last article, I have shared some of the free JavaScript books and this time I am sharing a couple of good free eBooks to learn jQuery. The jQuery is one of the most important skills in today's internet world. It is the JavaScript library which has changed the face of websites, they are now more interactive and smooth than ever before. The Internet is also not short of free resources and when it comes to learning jQuery, you will find thousands of articles and tens of eBooks, but not all resources are good. Some of them are not up-to-date and many of them contain incorrect information, hence choosing the good resource is vital.

Difference between @Autowired and @Inject annotation in Spring?

What is the difference between @Autowired and @Inject annotation in Spring is one of the frequently asked questions on Spring interviews? Since everybody is now moved or moving to annotation driven, Java configuration in Spring, this question has become even more important for prospective candidates looking for a Java web development job using Spring framework. The @Autowired annotation is used for auto-wiring in Spring framework. The Autowiring is a process on which Spring framework figure out dependencies of a Spring bean, instead of you, a developer, explicitly specifying them in the application context file. You can annotate fields and constructor using @Autowired to tell Spring framework to find dependencies for you.

Difference between CAST, CONVERT, and PARSE function in Microsoft SQL Server

Though all three, CAST, CONVERT and PARSE are used to convert one data type into another in SQL Server, there are some subtle differences between them.The  CAST method accepts just two parameters, expression, and target type, but CONVERT() also takes a third parameter representing the format of conversion, which is supported for some conversions, like between character strings and date time values. For example, CONVERT(DATE, '2/7/2015', 101) converts the character string '2/7/2015' to DATE using DATE format 101, representing United States standard. By using the PARSE function, you can also indicate the culture by using any culture supported by the Microsoft's  dot NET framework. For example, PARSE('7/8/2015' AS DATE USING 'en-US') parse the input literal as a DATE by using a United State English Culture, similar to 101 formatting style.

Difference between repaint and revalidate method in Java Swing

What is the difference between revalidate() and repaint() in Java Swing is one of the popular Swing Interview Questions especially on Investment banks? Though both methods sound similar, there is a subtle difference between them. the revalidate() method instruct LayoutManager to recalculate layout and often called once new components are added or removed from Container. The revalidate() can also trigger to call to the repaint() method to repaint components which have changed i.e. width, height or any other visible property, which can affect layout. On the other hand repaint() method puts a paint request in AWT thread, for repainting of a component on which it has called.

OCAJP 1Z0-808 - Best Books and Mock Exams for Java 8 OCA Certification

From the last couple of months, I have been helping few developers to prepare for Java 8 associate certification with exam code 1Z0-808, also known as OCAJP 8. From my experience, both for preparing for Sun certification and helping other developers to get Java certified, I can say that two keys to be successful in Oracle Java certification are choosing a good study guide and buying one or two top quality mock exam simulators. When I say success, it doesn't just passing the exam but scoring above 90% because passing score 65% is not very difficult to achieve and anybody can pass OCAJP8 by just a couple of month of practice but to score 90% and above is not that easy, you need to prepare and prepare hard. Since just passing OCAJP8 will not make the desired impact, I always suggest my students aim for 100%, so the n worst case then can still score above 90%.