This is a missing feature of the current gen-model code. If you were to establish the relationships in your code and try "appfuse:gen", it would fail. I'd suggest generating your model objects and UI, then manually establishing the relationships and modifying your UI. If this sounds too difficult for you, then AppFuse is probably not the best solution. ;-)
Matt On May 21, 2010, at 3:17 AM, Dike wrote: > > Thank u so much,but i have problem yet! > When i ran "mvn appfuse:gen-model",it can successful,but the Dept has't > relationships with Emp,generate the model like this: > Dept.java: > @Entity > @Table(name="dept",catalog="appDemo") > public class Dept extends BaseObject implements Serializable { > private Long did; > private String dname; > private String ddesc; > > @Id @GeneratedValue(strategy = GenerationType.AUTO) > public Long getDid() { > return this.did; > } > > public void setDid(Long did) { > this.did = did; > } > > @Column(name="dname", length=20) > public String getDname() { > return this.dname; > } > > public void setDname(String dname) { > this.dname = dname; > } > > @Column(name="ddesc", length=100) > public String getDdesc() { > return this.ddesc; > } > > public void setDdesc(String ddesc) { > this.ddesc = ddesc; > } > > public boolean equals(Object o) { > if (this == o) return true; > if (o == null || getClass() != o.getClass()) return false; > > Dept pojo = (Dept) o; > > if (dname != null ? !dname.equals(pojo.dname) : pojo.dname != null) > return false; > if (ddesc != null ? !ddesc.equals(pojo.ddesc) : pojo.ddesc != null) > return false; > > return true; > } > > public int hashCode() { > int result = 0; > result = (dname != null ? dname.hashCode() : 0); > result = 31 * result + (ddesc != null ? ddesc.hashCode() : 0); > > return result; > } > > public String toString() { > StringBuffer sb = new StringBuffer(getClass().getSimpleName()); > > sb.append(" ["); > sb.append("did").append("='").append(getDid()).append("', "); > sb.append("dname").append("='").append(getDname()).append("', "); > sb.append("ddesc").append("='").append(getDdesc()).append("'"); > sb.append("]"); > > return sb.toString(); > } > > } > > > and the Emp.java: > @Entity > @Table(name="emp",catalog="appDemo") > public class Emp extends BaseObject implements Serializable { > private Long eid; > private Long did; > private String ename; > > @Id @GeneratedValue(strategy = GenerationType.AUTO) > public Long getEid() { > return this.eid; > } > > public void setEid(Long eid) { > this.eid = eid; > } > > @Column(name="did") > public Long getDid() { > return this.did; > } > > public void setDid(Long did) { > this.did = did; > } > > @Column(name="ename", length=20) > public String getEname() { > return this.ename; > } > > public void setEname(String ename) { > this.ename = ename; > } > > public boolean equals(Object o) { > if (this == o) return true; > if (o == null || getClass() != o.getClass()) return false; > > Emp pojo = (Emp) o; > > if (did != null ? !did.equals(pojo.did) : pojo.did != null) return > false; > if (ename != null ? !ename.equals(pojo.ename) : pojo.ename != null) > return false; > > return true; > } > > public int hashCode() { > int result = 0; > result = (did != null ? did.hashCode() : 0); > result = 31 * result + (ename != null ? ename.hashCode() : 0); > > return result; > } > > public String toString() { > StringBuffer sb = new StringBuffer(getClass().getSimpleName()); > > sb.append(" ["); > sb.append("eid").append("='").append(getEid()).append("', "); > sb.append("did").append("='").append(getDid()).append("', "); > sb.append("ename").append("='").append(getEname()).append("'"); > sb.append("]"); > > return sb.toString(); > } > > } > > > NO relationships can be found between this two model,and can u sent to me > you model source?? > I worked with Windows 7 + Mysql 5.1 + Maven 2.2.1+Appfuse2.1.0 M1,what u > worked??It's that reason??? > -- > View this message in context: > http://appfuse.547863.n4.nabble.com/mvn-appfuse-gen-model-problem-tp2222446p2225859.html > Sent from the AppFuse - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net > For additional commands, e-mail: users-h...@appfuse.dev.java.net > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net For additional commands, e-mail: users-h...@appfuse.dev.java.net