I dont have a session bean at the moment (but should be no problem)

Is there no way to get a method in the Product Class to get the description for 
the specified language?

I don't understand how you want to "initialize" the Description ...
Do you mean that I should add a NamedQuery like this:


  | @Entity
  | @NamedQuery(name="getProductDescription", queryString="Select d from 
Description d where d.language_id >= :language_id")
  | public class Description{
  |     ...
  | }
  | 

But in this case I dont have the current Product...

If I choose this:


  | @Entity
  | @NamedQuery(name="getProductDescription", queryString="Select d from 
Description d where d.language_id >= :language_id and d.product_id >= 
:product_id")
  | public class Description{
  |     ...
  | }
  | 

I need both Id's, hmmm, this should be possible.

But there is the next problem: If I set up the Entity like this:


  | ...
  | @Id private int product_id;
  | @Id private int language_id;
  | ...
  | 

the table is set up wiht only 1 PK (e.g. product_id). I thought I only need a 
PK-Class for complex PKs (two integer seems not to be complex)

So if I have to set up a PK-Class, can I use the NamedQuery as listed above? 
(and do I need a PK-Class for two int-values?)

Thank you so far!
Andreas

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3917638#3917638

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3917638


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to