Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Hibernate不包括新的数据库信息_Java_Sql Server_Hibernate_Jsp - Fatal编程技术网

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关于新专栏的部分在哪里?