More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know.
Q724. What are the various Auto Wiring types in Spring ?
Ans. By Name , By Type and Constructor.
Help us improve. Please let us know the company, where you were asked this question :
LikeDiscussCorrect / Improve  java   spring   spring container   dependency injection   auto wiring   auto wiring types   general electric   ge
Q725. What are the the methods to clear cache in Hibernate ?
Ans. Lazy fetching is the technique of not loading the child objects when parent objects are loaded. By default Hibernate does not load child objects. One can specify whether to load them or not while doing the association.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Transient - In this state, an instance is not associated with any persistence context Persistent - In this state, an instance is associated with a persistence context Detached - This is a state for an instance which was previously associated with a persistence context an has been currently closed dissociated
Help us improve. Please let us know the company, where you were asked this question :
Ans. Assert works only if assertions ( -ea ) are enabled which is not required for Verify.Assert throws an exception and hence doesn't continue with the test if assert evaluates to false whereas it's not so with Verify.
Help us improve. Please let us know the company, where you were asked this question :
Ans. The first annotation will try to map the Class with the Table as of same name as Class whereas the second annotation will specify the Entity name as "EMPLOYEES" and hence will try to map with Table Name "EMPLOYEES".
Help us improve. Please let us know the company, where you were asked this question :
Ans. Instead of Saving Parent as well as Child Entities individually , Hibernate provides the option to persist / delete the related entities when the Parent is persisted.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Yes but as Hibernate creates the Proxy Classes inherited from the Entity Classes to communicate with Database for lazy initialization. Declaring entity classes as final will prohibit communication with database lazily and hence will be a performance hit.
Help us improve. Please let us know the company, where you were asked this question :
Q750. What are the annotations used in Junit with Junit4 ?
Ans. @Test
The Test annotation indicates that the public void method to which it is attached can be run as a test case.
@Before
The Before annotation indicates that this method must be executed before each test in the class, so as to execute some preconditions necessary for the test.
@BeforeClass
The BeforeClass annotation indicates that the static method to which is attached must be executed once and before all tests in the class.
@After
The After annotation indicates that this method gets executed after execution of each test.
@AfterClass
The AfterClass annotation can be used when a method needs to be executed after executing all the tests in a JUnit Test Case class so as to clean-up the set-up.
@Ignores
The Ignore annotation can be used when you want temporarily disable the execution of a specific test.
Help us improve. Please let us know the company, where you were asked this question :