Vivek Singh

Ranch Hand
+ Follow
since Oct 27, 2009
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Vivek Singh

So One Department can have Many employees.

Put Cascade as None.What is the constraint?
Employee table put department discriptor.

Post your code also sample code.
So why Regular expression is required?
As you know the exact text which you need so try this.

10 years ago
You may try with @AfterThrowing or @Arround....Advice
i am not sure if this is possible as the compiler only creates a blank constructor. So you are not sure about the TYPE and Number of params in your constructor. I am not sure what you want to achive

May be varargs can be used not sure how in your problem.

Or may be

10 years ago

Raj Rajesh wrote: I can pass these details as a method param

Do you mean the params in the constructor?

Please write your constructor and explain what you want to achieve?...
10 years ago
Change the Name of all the files (xml & java)and try again.
What is your mapping file???

Sri Vatsa wrote:

You are trying to apply equals method to a NULL . So it throws Null pointer Exception..
10 years ago

Campbell Ritchie wrote:Maybe you can use

private static final Singleton<T> instance;

instead. Using final will reduce the risk of your instantiating it twice by mistake.

This is the best and smartest way to introduce Singleton.
10 years ago
Autowired annotation is used in wrong way.

As in your this is a bean so to test this bean. Added getter and setter to the property photoTypeMap in your pojo.
in your XML file You have already defiened the bean so need for annotations remove all annotations.

In the test Class get the the bean.

Please use code Tags...Just edit your code and use Code tags
10 years ago

sriram ks wrote:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring-dispatcher-servlet.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/wiley/jfib/ch12/store/vo/Cart.hbm.xml

Post your problem not the Error Logs it is difficult to tell the Root cause......
10 years ago

Anurag Pathak wrote:
Can Any body explain Encapsulation in Java how it is achived through small practical example.

A simple pojo class with some getter and setters. Represents Encapsulation.

Difference from Abstraction.
list is an List object. So the User doesn't know about the inner implementation details of List
But we can perform many actions with this object. Like:-
So the List class is capsuled with these Methods.

Where as while using it in our programs we are abstracting those methods.Unaware of the inner details.

So we can say Abstraction is achieved by encapsulation.
10 years ago

nick kaushik wrote:hi guys..
my question is about System.out.println()....... Now System is a class we know that... out is a variable & println()/print() are is it possible that class name & variable are both used to call a method?can somebody please explain this how is it happening?
thanks in advance

Just look at the signatures...
is an object of
Where as
10 years ago

Sowm Herur wrote:
I wanted to understand as String are also objects they can be just put in a hashmap using map.put("Name","Sowmya");

Yes, have a look at the code that i have attached.But its not a GOOD PRACTICE to have string Key.
10 years ago

Adithya Bhat wrote:

Hey you have not initialized the so it throws NULL POINTER Exception.
10 years ago

What exactly you want to achieve??
10 years ago