Struts Problem Report Struts has detected an unhandled exception: Messages: M
Struts Problem Report
Struts has detected an unhandled exception:
Messages:
Movie is not mapped [from Movie m where m.type=1]
Movie is not mapped [from Movie m where m.type=1]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: Movie is not mapped [from Movie m where m.type=1]
File: org/hibernate/hql/ast/util/SessionFactoryHelper.java
Line number: 180
Stacktraces
org.springframework.orm.hibernate3.HibernateQueryException: Movie is not mapped [from Movie m where m.type=1]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: Movie is not mapped [from Movie m where m.type=1]
org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:664)
org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:912)
org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:904)
com.guang.dao.impl.MovieDAOImpl.gettypecountByid(MovieDAOImpl.java:166)
com.guang.service.impl.MovieServiceImpl.getMpagerBytype(MovieServiceImpl.java:89)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
com.sun.proxy.$Proxy5.getMpagerBytype(Unknown Source)
package com.guang.service.impl;
import java.util.List;
import com.guang.dao.MovieDAO;
import com.guang.model.Movie;
import com.guang.service.MovieService;
//import com.guang.utils.FileUtils;
import com.guang.utils.PageBean;
import com.guang.utils.timeUtil;
public class MovieServiceImpl implements MovieService {
private MovieDAO moviedao;
public void addMovie(Movie movie) {
movie.setUploadtime(timeUtil.getnowdate());
moviedao.add(movie);
}
public void setMoviedao(MovieDAO moviedao) {
this.moviedao = moviedao;
}
public MovieDAO getMoviedao() {
return moviedao;
}
public List<Movie> getnew10M() {
return moviedao.getnew10Movie();
}
public Movie getMbyid(int id) {
return moviedao.getMbyid(id);
}
public void modifyPcount(Movie movie) {
int numPre=movie.getPcount();
int numAfter=numPre+1;
moviedao.addPcount(movie, numAfter);
}
public List<Movie> gettop10M() {
return moviedao.gettop10M();
}
public PageBean getAllMpager(int pagesize, int page) {
//final String hql = "from User";//查询语句
int allRow = moviedao.getallcount();//总记录数
int totalPage = PageBean.countTotalPage(pagesize, allRow);//总页数
final int offset = PageBean.countOffset(pagesize, page);//当前页开始记录
final int length = pagesize;//每页记录数
final int currentPage = PageBean.countCurrentPage(page);
List<Movie> list = moviedao.getallMpager(offset, pagesize);//"一页"的记录
//把分页信息保存到Bean中
PageBean pageBean = new PageBean();
pageBean.setPageSize(pagesize);
pageBean.setCurrentPage(currentPage);
pageBean.setAllRow(allRow);
pageBean.setTotalPage(totalPage);
pageBean.setList(list);
pageBean.init();
return pageBean;
}
public PageBean getMpagerBytype(int id, int pagesize, int page) {
int allRow = moviedao.gettypecountByid(id);//总记录数
int totalPage = PageBean.countTotalPage(pagesize, allRow);//总页数
final int offset = PageBean.countOffset(pagesize, page);//当前页开始记录
final int length = pagesize;//每页记录数
final int currentPage = PageBean.countCurrentPage(page);
List<Movie> list = moviedao.getMpagerBytype(id, offset, pagesize);//"一页"的记录
//把分页信息保存到Bean中
PageBean pageBean = new PageBean();
pageBean.setPageSize(pagesize);
pageBean.setCurrentPage(currentPage);
pageBean.setAllRow(allRow);
pageBean.setTotalPage(totalPage);
pageBean.setList(list);
pageBean.init();
return pageBean;
}
}