[JBoss-user] [EJB 3.0] - Re: mapping unidirectional relation with parameterised compo

2006-01-16 Thread [EMAIL PROTECTED]
Hello,

Did you try to map your Collection and after add your getProductDescription(int 
pLangugeId) (and make a while to search the good description for the specified 
language ?)

It's not a very clean solution.

I will search for cleaner solution ;)

Good luck 

@soon

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3917621#3917621

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3917621


---
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=7637alloc_id=16865op=click
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: mapping unidirectional relation with parameterised compo

2006-01-16 Thread Andy.2003
Yes, I managed to set up a OneToMany relation like:
public SetDescription getDescriptions(); but this is not what I'm searching 
for. I dont want to fetch all description-entries for an product, I only need 
the entry for the specified language.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3917634#3917634

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3917634


---
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=7637alloc_id=16865op=click
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: mapping unidirectional relation with parameterised compo

2006-01-16 Thread [EMAIL PROTECTED]
I think you must use a Session Bean Façade to initialize your Description (by 
an EJB QL).

Why do you think about it ?
I think you have already a session bean (to represent a DAO or a service) ?
So it would be easy to set the good description for the current language of 
user for example.



View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3917635#3917635

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3917635


---
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_idv37alloc_id865op=click
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: mapping unidirectional relation with parameterised compo

2006-01-16 Thread Andy.2003
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=bbop=viewtopicp=3917638#3917638

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=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=7637alloc_id=16865op=click
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: mapping unidirectional relation with parameterised compo

2006-01-16 Thread [EMAIL PROTECTED]
Did you try to make 2 relationships in your description POJO ? 

In hibernate there was ternary Associations : 
http://www.xylax.net/hibernate/ternary.html

I haven't tried this but I think you can define the two relationship and set 
the primary key with JoinColumn annotation.
I am not sure !
Look at this : 
http://www.goobsoft.com/resin-doc/ejb3/[EMAIL PROTECTED]
At the @JoinColumn.

If you try it can you tell me if it works ?

Thanks.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3917649#3917649

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3917649


---
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=7637alloc_id=16865op=click
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: mapping unidirectional relation with parameterised compo

2006-01-16 Thread Andy.2003
I want a unidirectional access to the Description - Class, this means, in the 
Description - Class there is no variable storing the Product, so I cant create 
a ManyToOne mapping.
If I setup following mapping in the Product Class I get only one PK in the 
Description Table:


  | @OneToMany
  | public SetDescription getDescriptions(){
  | return ivDescription;
  | }
  | 

...

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3917661#3917661

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3917661


---
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=7637alloc_id=16865op=click
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: mapping unidirectional relation with parameterised compo

2006-01-16 Thread [EMAIL PROTECTED]
Yes, I see...
You try to use an existing DataBase ...

I saw that : 
http://jroller.com/page/raghukodali?entry=ejb_3_annotations_for_mapping

I think it can help you.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3917665#3917665

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3917665


---
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=7637alloc_id=16865op=click
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user