我正在构建一个涉及跟踪不同类型潜在客户的Laravel应用程序.例如,有再融资线索和购买线索.
由于引线共享大量的信息和功能,但不是全部,我的想法是创建一个Lead类,它扩展了Laravel的Model类,然后是一个RefinanceLead扩展Lead类的类.
所以我有:
class Lead extends Model
{
// shared lead stuff
}
class RefinanceLead extends Lead
{
// stuff specific to refinance leads
}
Run Code Online (Sandbox Code Playgroud)
我的问题是:
leads桌子和refinance_leads桌子吗?leads表中的任何内容?我在通过文档回答这个问题时遇到了麻烦,但是如果我错过了解释的地方,请告诉我.谢谢.
我知道很多人都问过这个问题,但我刚开始使用Java,所以我还是想不通.
所以这是我的问题:我正在使用RESTful webservices Javarestlet.这是我的DAO文件的片段.
try {
session.beginTransaction();
String query = "select number from blockedcli";
@SuppressWarnings("rawtypes")
List list = session.createQuery(query).list(); //.setString("sId", businessId)
logger.error("*******************list*****************************************");
logger.error(list);
logger.error("*******************listend*****************************************");
@SuppressWarnings("rawtypes")
Iterator iterator = list.iterator();
while (iterator.hasNext()) {
blockedcli = (BlockedCli) iterator.next();
}
session.getTransaction().commit();
}
Run Code Online (Sandbox Code Playgroud)
相应地,我的实体类看起来像.
@Entity
@Table(name = "blockedcli")
public class BlockedCli implements Serializable{
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="idBlockedCLI", nullable = false, unique=true)
private Integer idBlockedCLI;
@Column(name = "number",nullable = false, length=45)
private String number;
@Column(name = …Run Code Online (Sandbox Code Playgroud)