http://forum.java.sun.com/thread.jspa?t ... &tstart=15
hi. i've explained my problem in another thread but i guess the subject doesn't relate to the body there.
well, better i give you a short explanation of the task given to me. i do have an ..(how t o say)..a table GROUPS where i can view, make changes to gruops and add new ones. Each group has its primary key ID, group name. i have also the second table Members. as i guess, each member should have a foreign key from GROUPS (ID), and a primary key.
and now what i'm trying to do is to insert a Members line into each group.
here is the code snippet to create a group, but where and what should i type in here to insert a List also??
package com.jbossatwork.dto;
import java.io.*;
/**
* @hibernate.class
* table="GROUPS"
*/
public class GroupsDTO implements Serializable
{
public static final String STATUS_AVAILABLE = "Available";
public static final String STATUS_SOLD = "Sold";
private int id;
private String groupName;
private String status;
// maybe here
private List memberList;
public GroupsDTO()
{
this.id = -1;
this.groupName = "";
this.status = GroupsDTO.STATUS_AVAILABLE;
// and here..
this.memberList =
}
public GroupsDTO(String groupName)
{
this.id = -1;
this.groupName = groupName;
this.status = GroupsDTO.STATUS_AVAILABLE;
}
public GroupsDTO(int id, String groupName)
{
this.id = id;
this.groupName = groupName;
this.status = GroupsDTO.STATUS_AVAILABLE;
}
/**
* @hibernate.id
* generator-class="native"
* column="ID"
*/
public int getId()
{
return id;
}
public void setId(int id)
{
this.id = id;
}
/**
* @hibernate.property
* column="GROUP_NAME"
*/
public String getGroupName()
{
return groupName;
}
public void setGroupName(String groupName)
{
this.groupName = groupName;
}
/**
* @hibernate.property
* column="STATUS"
*/
public String getStatus()
{
return status;
}
public void setStatus(String status)
{
this.status = status;
}
}
thanks in advance,
lema