This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

Arunsanjay Jayarathanam

+ Follow
since Oct 17, 2010
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 Arunsanjay Jayarathanam

I believe your intention is to use the Company Id as one of the properties to uniquely identify an employee.
In order to do that , you need to have an IdClass composite of the properties ( empid, companyid) that uniquely
identify the employee in a separate class; and Have a relationship with the Company entity in the
Employee entity and as well use it as @Id property. Something like ,

(Note : the above code might not be the exact code, but something in the same lines. refer to the below link for details)
Refer to JPA Composite Primary Keys, for detailed explanation.

Go through the JPA 2.0 examples in the above link
If I haven't misunderstood your problem, I think you are looking for a one to many unidirectional relationship without using an intermediate class as well without an intermediate table in the database?? Assuming that is right,here is an example that provides you a solution

JPA Wiki
Can you give us more details about the error that occurs??

Ravi Kiran Va wrote:I currently dont remember exactly how to do this , but as per my knowledge you need to google on
"Configuring MDB Message Selectors"

and for this to work you need to set Header properties to your Message also .

Google it you will find it .

before sending a message to a queue or topic add a property to it which would uniquely identify it like

ObjectMessage obj = session.createObjectMessage();

and when configuring the listener or the mdb to listen to a queue and pickup only messages which have type "XYZ"

String messageSelector = "type = 'XYZ'"
TopicSubscriber sub = session.createSubscriber(topicName,messageSelector,true);

there are numerous operators other than '=', you can even do a wildcard match for the messageSelector like "'type LIKE 'XYZ%'"
this is with reference to ActiveMQ. the creation of subscriber might vary depending upon the third party provider.
i would suggest to start of with EJB .30. A good book for those who are new can be

It explains the concepts well alongwith detailed examples.