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: [email protected]
For additional commands, e-mail: [email protected]