Java Hibernate不包括新的数据库信息
我正在使用Java Hibernate不包括新的数据库信息,java,sql-server,hibernate,jsp,Java,Sql Server,Hibernate,Jsp,我正在使用hibernate2和MsSQL作为我的数据库。我在数据库中添加了一列,当我尝试访问它时,会出现以下异常: System.out.println((((Project)tempList.get(0)).getIsActive())); 它不起作用。我总是得到null。我认为getHibernateTemplate()正在创建一个项目,而不包括活动字段。我不明白 public Project findProject(String projectId) throws Exception
hibernate2
和MsSQL
作为我的数据库。我在数据库中添加了一列,当我尝试访问它时,会出现以下异常:
System.out.println((((Project)tempList.get(0)).getIsActive()));
它不起作用。我总是得到null
。我认为getHibernateTemplate()
正在创建一个项目,而不包括活动字段。我不明白
public Project findProject(String projectId) throws Exception
{
Project proj = null;
String queryStr = "from Project p where p.projectId=?";
Object[] questionMark = new Object[]{new String(projectId)};
List tempList = getHibernateTemplate().find(queryStr, questionMark);
if(tempList.size()>0)
{
proj = (Project)(tempList.get(0));
}
System.out.println((((Project) tempList.get(0)).getProjectId()));
System.out.println((((Project)tempList.get(0)).getIsActive()));
return proj;
//find why this does not include the active state!!
}
你确定你在使用Hibernate 2吗?那真的,真的,真的(令人尴尬地)太老了。Hibernate3.0于2005年推出。我的药柜里甚至没有任何可以追溯到那个时候的东西。你们只把这个专栏添加到数据库中了吗?告诉hibernate关于新专栏的部分在哪里?