anyway, thank u  Eric Fitzsimmons

well, i think u misunderstand my point

let me put it this way

assum that there is a "form" (called maintain)which has a "applyPerson" and
a "confirmPerson"

then the "form"(called maintain) bean is:

------------------------------------------------------------------------------------------------------------

import org.appfuse.model.BaseObject;   

import javax.persistence.*;
import javax.persistence.Entity;   
import javax.persistence.GenerationType;   
import javax.persistence.Id;   
import javax.persistence.GeneratedValue;   
import javax.persistence.Column;   


import java.util.*;

@Entity 
public class Maintain extends BaseObject{
        
        private Long id;
        private Person applyPerson,confirmPerson;
        private String description;     
        private Date applyTime;
        
        @ManyToOne
    @JoinColumn(name="APPPERSON_ID", nullable=false)
        public Person getApplyPerson() {
                return applyPerson;
        }

        public void setApplyPerson(Person applyPerson) {
                this.applyPerson = applyPerson;
        }
        
        
        @ManyToOne
    @JoinColumn(name="CONPERSON_ID", nullable=false)
        public Person getConfirmPerson() {
                return confirmPerson;
        }

        public void setConfirmPerson(Person confirmPerson) {
                this.confirmPerson = confirmPerson;
        }

        @Column(name="applytime") 
        public Date getApplyTime() {
                return applyTime;
        }

        public void setApplyTime(Date applyTime) {
                this.applyTime = applyTime;
        }
        
        
        @Column(name="description", length=500)  
        public String getDescription() {
                return description;
        }

        public void setDescription(String description) {
                this.description = description;
        }

        @Id @GeneratedValue(strategy = GenerationType.AUTO)   
        public Long getId() {
                return id;
        }

        public void setId(Long id) {
                this.id = id;
        }
}

--------------------------------------------------------------------------------------------------------

ok, another bean we called "Person"(applyPerson and confirmPerson are from
here)

---------------------------------------------------------------------------------------------------------
import org.appfuse.model.BaseObject;   

import javax.persistence.*;
import javax.persistence.Entity;   
import javax.persistence.GenerationType;   
import javax.persistence.Id;   
import javax.persistence.GeneratedValue;   
import javax.persistence.Column;   


import java.util.*;

@Entity
public class Person extends BaseObject{

        private Long id;
        private String name;
        private Set<Maintain> applyMaintains = new HashSet<Maintain>(),
                           confirmMaintains = new HashSet<Maintain>();

        @Id @GeneratedValue(strategy = GenerationType.AUTO) 
        public Long getId() {
                return id;
        }
        public void setId(Long id) {
                this.id = id;
        }
        @Column(name="name")
        public String getName() {
                return name;
        }
        public void setName(String name) {
                this.name = name;
        }
        
        
        @OneToMany(targetEntity=Maintain.class,mappedBy="applyPerson")
        public Set<Maintain> getApplyMaintains() {
                return applyMaintains;
        }
        public void setApplyMaintains(Set<Maintain> applyMaintains) {
                this.applyMaintains = applyMaintains;
        }
        
        
        @OneToMany(targetEntity=Maintain.class,mappedBy="confirmPerson")
        public Set<Maintain> getConfirmMaintains() {
                return confirmMaintains;
        }
        public void setConfirmMaintains(Set<Maintain> confirmMaintains) {
                this.confirmMaintains = confirmMaintains;
        }
        
}

------------------------------------------------------------------------------------------------------

then, back to the beginning,
everything(CRUD) on Person is doing well
but, when i try to delete or save(add new&update) a "maintain form", there
comes problem
here is the situation, when i click the delete or save button, it just turns
to a blank page
and in the cmd window(jetty-run window)....occurs lots error messages(over
50lines), so its hard for me to determine what is the exact reason caused
that. 

i'm not sure whether i make it clear enough this time

i appreciate your patience, Eric Fitzsimmons(all u guys who reads this topic
as well)
-- 
View this message in context: 
http://www.nabble.com/one-to-many-problem-on-appfuse2.0-m4-tf3731354s2369.html#a10451483
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to