关于弹簧数据我做了PageCommon但是我得到了异常
myrestcontroller:
@Secured({"EMAKET_DEVELOPER", "EMAKET_BACK"})
@RequestMapping(value = "/getExceptionListLogs", method = GET)
public ResponseEntity getDocList(@RequestParam(value = "start", required = false) Integer start,
@RequestParam(value = "count", required = false) Integer count,
@RequestParam(value = "rn") String rn) {
return ResponseEntity.status(HttpStatus.ACCEPTED).body(otherImpl.getExceptionListLogs(start, count, rn));
}
服务
@Override
public PageCommon getExceptionListLogs(Integer start, Integer count, String rn) {
if (start == null || start == 0 || count == null || count == 0) {
start = DEF_START_ZERO;
count = DEF_CNT_DECLAR;
}
PageRequest request = PageRequest.of(start, count, Sort.Direction.ASC, "id");
Page<ExcControlLog> exc = excControlLogRepository.findAll(request);
return wrapPageToPageCommon(exc);
}
存储库
@Repository
public interface ExcControlLogRepository extends JpaRepository<ExcControlLog, String> {
}
实体
@Entity
@Table(name = "EXC_CONTROL_LOG", schema = "em5")
public class ExcControlLog implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name = "ID")
private BigDecimal id;
@JoinColumn(name = "SICID", referencedColumnName = "SICID")
@ManyToOne(optional = true, targetEntity = Person.class)
private Person person;
@Column(name = "TYPE")
private String type;
@Column(name = "DAT")
@Temporal(TemporalType.TIMESTAMP)
private Date dat;
@Column(name = "BRID")
private String brid;
@Column(name = "USR")
private String user;
@JoinColumn(name = "ID_EXC", referencedColumnName = "ID")
@OneToOne(optional = false)
private ExcControl excControl;
@Column(name = "IP")
private String ip;
}
堆
org.springframework.web.util.NestedServletException:Request 处理失败;嵌套异常是 org.springframework.dao.InvalidDataAccessResourceUsageException:可以 不提取ResultSet; SQL [不适用];嵌套异常是 org.hibernate.exception.SQLGrammarException:无法解压缩 结果集 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:986) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:870) javax.servlet.http.HttpServlet.service(HttpServlet.java:635) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:855) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:320) org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:334) org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119) org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:334) org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:334) org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:334) org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:334) org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:334) org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200) org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:334) org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:334) org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:334) org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:334) org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:334) org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270) org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
EXC_CONTROL
@Entity
@Table(name = "EXC_CONTROL", schema = "em5")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "ExcControl.findAll", query = "SELECT m FROM ExcControl m"),
@NamedQuery(name = "ExcControl.findByOsn11", query = "SELECT m FROM ExcControl m WHERE m.osn.id = 11"),
@NamedQuery(name = "ExcControl.findByOsnNull", query = "SELECT m FROM ExcControl m WHERE m.osn is null ")
})
@Getter
@Setter
public class ExcControl implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name = "ID")
private BigDecimal id;
@JoinColumn(name = "SICID", referencedColumnName = "SICID")
@ManyToOne(targetEntity = Person.class)
private Person person;
@Column(name = "DAT")
@Temporal(TemporalType.TIMESTAMP)
private Date dat;
@JoinColumn(name = "OSN", referencedColumnName = "ID")
@ManyToOne(optional = true, targetEntity = ZOsn.class)
private ZOsn osn;
@OneToOne(cascade = CascadeType.ALL, mappedBy = "excControl")
private ExcControlLog excControl;
public ExcControl() {
}
}
人
@Entity
@Cacheable(false)
@Table(name = "PERSON")
@Getter
public class Person implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name = "SICID")
private BigDecimal sicid;
@Column(name = "ACTID")
private long actid;
@Size(max = 30)
@Column(name = "LASTNAME")
private String lastname;
@Size(max = 30)
@Column(name = "FIRSTNAME")
private String firstname;
@Size(max = 30)
@Column(name = "MIDDLENAME")
private String middlename;
public Person() {
}
}