Hello,
I have the following PostgreSQL tables:
CREATE TABLE articles(
article_id INTEGER PRIMARY KEY,
title VARCHAR(40)
) ;
CREATE TABLE keywords(
article_id INTEGER REFERENCES articles,
keyword VARCHAR(20),
PRIMARY KEY(article_id, keyword)
) ;
I also have the following Java object:
public class Article {
protected int id;
protected String title;
protected java.util.Vector keywords;
/* ... The appropriate get/set methods also provided */
}
The keywords Vector data member of the Article object should hold all the
keywords that belongs to the article having the the same article_id in the
table keywords.
How to bind the keyword vector in the object using the <sql> element to get
the correct behavior?
<class name="Article" identity="id">
<map-to table="articles"/>
<field name="id" type="integer">
<sql name="id" type="integer"/>
</field>
<field name="title" type="string">
<sql name="title" type="char"/>
</field>
<field name="keywords" type="string" collection="vector">
<!-- WHAT COMES HERE??? -->
</field>
</field>
Thanks in advance,
Peter
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev