0
我怎麼聯接,將返回我的結果類似於TO-你如何在hibernate activerecord中加入?
SELECT * FROM Project LEFT JOIN ProjectRegion ON ProjectRegion.id = Project.projectRegion
我目前使用的syntax-
Project[] projects = Project.FindAll();
我的表是建立與ActiveRecord的/休眠如下 -
[ActiveRecord]
public class ProjectRegion : ActiveRecordBase<ProjectRegion>
{
private int id;
private String title;
public ProjectRegion()
{
}
[PrimaryKey]
public int Id
{
get { return id; }
set { id = value; }
}
[Property]
public String Title
{
get { return title; }
set { title = value; }
}
}
[ActiveRecord]
public class Project : ActiveRecordBase<Project>
{
private int id;
private String projectNumber;
private String projectRegion;
public Project()
{
}
[PrimaryKey]
public int Id
{
get { return id; }
set { id = value; }
}
[Property]
public String ProjectInternalCode
{
get { return projectNumber; }
set { projectNumber = value; }
}
[Property]
public String ProjectRegion
{
get { return projectRegion; }
set { projectRegion = value; }
}
...
不應該在Project類中的ProjectRegion屬性的類型是ProjectRegion而不是字符串? – 2009-09-03 14:03:39
好吧,這是有道理的,但仍然不會做聯合會嗎? – wkstar 2009-09-03 14:07:27