-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: MemberList in each Group of Grouplist. pls HELP with Busines
PostPosted: Tue Aug 07, 2007 5:58 am 
Newbie

Joined: Tue Jul 24, 2007 5:58 am
Posts: 8
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.