6 Replies Latest reply on Sep 12, 2009 3:38 PM by coalas

    Porblem filtering by date :S

    asdren.k

      Hi!


      I searched throw the forum and i found some posts about this topic but i still can't figer it out, where/what is the problem cause.


      The problem is:
      I have a form(generated from seam and then modified for my needs).
      When i want to search(filter) by between two dates it throuws these exceptions:


      javax.faces.FacesException: javax.el.ELException: /LogeventList.xhtml @102,61 rendered="#{empty logeventList.resultList}": Error reading 'resultList' on type at.siemens.azobis.session.LogeventList_$$_javassist_1
              at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:393)
              at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:276)
              at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
              at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:220)
              at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:215)
              at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121)
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
              at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
              at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
              at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:196)
              at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
              at java.lang.Thread.run(Thread.java:619)
      Caused by: javax.el.ELException: /LogeventList.xhtml @102,61 rendered="#{empty logeventList.resultList}": Error reading 'resultList' on type at.siemens.azobis.session.LogeventList_$$_javassist_1
              at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
              at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:390)
              ... 56 more
      Caused by: java.lang.NullPointerException
              at org.hibernate.hql.ast.ParameterTranslationsImpl.getNamedParameterExpectedType(ParameterTranslationsImpl.java:63)
              at org.hibernate.engine.query.HQLQueryPlan.buildParameterMetadata(HQLQueryPlan.java:296)
              at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:97)
              at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
              at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
              at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
              at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
              at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
              at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:92)
              at org.jboss.seam.persistence.EntityManagerProxy.createQuery(EntityManagerProxy.java:81)
              at org.jboss.seam.framework.EntityQuery.createQuery(EntityQuery.java:175)
              at org.jboss.seam.framework.EntityQuery.initResultList(EntityQuery.java:73)
              at org.jboss.seam.framework.EntityQuery.getResultList(EntityQuery.java:65)
              at sun.reflect.GeneratedMethodAccessor265.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
              at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
              at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:95)
              at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
              at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:89)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
              at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
              at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
              at at.siemens.azobis.session.LogeventList_$$_javassist_1.getResultList(LogeventList_$$_javassist_1.java)
              at sun.reflect.GeneratedMethodAccessor264.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at javax.el.BeanELResolver.getValue(BeanELResolver.java:62)
              at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
              at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
              at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
              at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
              at org.jboss.el.parser.AstEmpty.getValue(AstEmpty.java:29)
              at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
              at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
              ... 57 more
      



      And here are my files:


      LogeventList.xhtml


      <ui:define name="body">
      
          <table border="0" width="100%" id="table6">
                      <tr>
                      <td width="128">
                              <img border="0" src="img/DoorSurveillance.png" width="128" height="128"></img>
                              </td>
                      <td>
                              <b><font size="6" face="Arial">Door Surveillance</font></b>
                              </td>
                      <td width="185">
                              <img border="0" src="img/AZOBISHeader.png" width="151" height="128" align="right"></img>
                              </td>
                      </tr>
              </table>
      
          <h:form id="logeventSearch" styleClass="edit">
      
              <rich:simpleTogglePanel label="Logevent Search Filter" switchType="ajax">
      
                      <table border="0" width="100%" id="tableSearch">
                              <tr>
                                      <td>
                                          <s:decorate template="layout/display.xhtml">
                                          <ui:define name="label">Log Message</ui:define>
                                              <h:inputText id="logMessage" value="#{logeventList.logevent.logMessage}"/>
                                      </s:decorate>
                              </td>
                              <td>
                                          <s:decorate template="layout/display.xhtml">
                                          <ui:define name="label">Transponder</ui:define>
                                              <h:inputText id="transponderId" value="#{logeventList.logevent.transponderId}"/>
                                      </s:decorate>
                              </td>
                              <td>
                                          <s:decorate template="layout/display.xhtml">
                                          <ui:define name="label">User</ui:define>
                                              <h:inputText id="user" value="#{logeventList.logevent.user}"/>
                                      </s:decorate>
                              </td>
                              </tr>
                              <tr>
                                      <td>
                                      <s:decorate template="layout/display.xhtml">
                                              <ui:define name="label">Date from</ui:define>
                                                      <rich:calendar id="timeFrom" 
                                                                                 value="#{logeventList.logevent.timeFrom}"
                                                                     datePattern="dd.MM.yyyy"
                                                                                                 enableManualInput="true"/>
      <!--  
                                                                     datePattern="dd.MM.yyyy HH:mm"
                                                                     defaultTime="00:00"
      -->
      
                                      </s:decorate>
                                      </td>
                                      <td>
                                      <s:decorate template="layout/display.xhtml">
                                              <ui:define name="label">Date to</ui:define>
                                                      <rich:calendar id="timeTo" 
                                                                                 value="#{logeventList.logevent.timeTo}"
                                                                     
                                                                     datePattern="dd.MM.yyyy"
                                                                     enableManualInput="true"/>
      <!--
                                                                         showApplyButton="true"/>
                                                                     defaultTime="23:59"/>                                                            
                                                                         datePattern="dd.MM.yyyy HH:mm"
      -->
      
      
                                      </s:decorate>
                                      </td>
                      </tr>
                  </table>
      
              </rich:simpleTogglePanel>
      
              <div class="actionButtons">
                  <h:commandButton id="search" value="Search" action="/LogeventList.xhtml"/>
                  <s:button id="reset" value="Reset" includePageParams="false"/>
              </div>
      
          </h:form>
      
          <rich:panel>
              <f:facet name="header">Logevent Search Results</f:facet>
          <div class="results" id="logeventList">
              
      
          <h:outputText value="The logevent search returned no results."
                     rendered="#{empty logeventList.resultList}"/>
              
          <rich:dataTable id="logeventList"
                      var="_logevent"
                    value="#{logeventList.resultList}"
                 rendered="#{not empty logeventList.resultList}">
              <h:column rendered="#{s:hasRole('root')}">
                  <f:facet name="header">
                      <ui:include src="layout/sort.xhtml">
                          <ui:param name="entityList" value="#{logeventList}"/>
                          <ui:param name="propertyLabel" value="Id"/>
                          <ui:param name="propertyPath" value="logevent.id"/>
                      </ui:include>
                  </f:facet>
                  <h:outputText value="#{_logevent.id}"/>
              </h:column>
              <h:column rendered="#{s:hasRole('root')}">
                  <f:facet name="header">
                      <ui:include src="layout/sort.xhtml">
                          <ui:param name="entityList" value="#{logeventList}"/>
                          <ui:param name="propertyLabel" value="Equipment Id"/>
                          <ui:param name="propertyPath" value="logevent.equipment.id"/>
                      </ui:include>
                  </f:facet>
                  <h:outputText value="#{_logevent.equipment.id}"/>
              </h:column>
              <h:column>
                  <f:facet name="header">
                      <ui:include src="layout/sort.xhtml">
                          <ui:param name="entityList" value="#{logeventList}"/>
                          <ui:param name="propertyLabel" value="Equipment Number"/>
                          <ui:param name="propertyPath" value="logevent.equipment.equipmentNumber"/>
                      </ui:include>
                  </f:facet>
                  <h:outputText value="#{_logevent.equipment.equipmentNumber}"/>
              </h:column>
              <h:column>
                  <f:facet name="header">
                      <ui:include src="layout/sort.xhtml">
                          <ui:param name="entityList" value="#{logeventList}"/>
                          <ui:param name="propertyLabel" value="Description"/>
                          <ui:param name="propertyPath" value="logevent.equipment.description"/>
                      </ui:include>
                  </f:facet>
                  <h:outputText value="#{_logevent.equipment.description}"/>
              </h:column>
              <h:column>
                  <f:facet name="header">
                      <ui:include src="layout/sort.xhtml">
                          <ui:param name="entityList" value="#{logeventList}"/>
                          <ui:param name="propertyLabel" value="Log Message"/>
                          <ui:param name="propertyPath" value="logevent.logMessage"/>
                      </ui:include>
                  </f:facet>
                  <h:outputText value="#{_logevent.logMessage}"/>
              </h:column>
              <h:column>
                  <f:facet name="header">
                      <ui:include src="layout/sort.xhtml">
                          <ui:param name="entityList" value="#{logeventList}"/>
                          <ui:param name="propertyLabel" value="Time"/>
                          <ui:param name="propertyPath" value="logevent.time"/>
                      </ui:include>
                  </f:facet>
                  <h:outputText value="#{_logevent.time}">
                      <s:convertDateTime pattern="dd.MM.yyyy HH:mm:ss"/>
                  </h:outputText>
              </h:column>
              <h:column>
                  <f:facet name="header">
                      <ui:include src="layout/sort.xhtml">
                          <ui:param name="entityList" value="#{logeventList}"/>
                          <ui:param name="propertyLabel" value="Transponder"/>
                          <ui:param name="propertyPath" value="logevent.transponderId"/>
                      </ui:include>
                  </f:facet>
                  <h:outputText value="#{_logevent.transponderId}"/>
              </h:column>
              <h:column>
                  <f:facet name="header">
                      <ui:include src="layout/sort.xhtml">
                          <ui:param name="entityList" value="#{logeventList}"/>
                          <ui:param name="propertyLabel" value="Type"/>
                          <ui:param name="propertyPath" value="logevent.type"/>
                      </ui:include>
                  </f:facet>
                  <h:outputText value="#{_logevent.type}"/>
              </h:column>
              <h:column>
                  <f:facet name="header">
                      <ui:include src="layout/sort.xhtml">
                          <ui:param name="entityList" value="#{logeventList}"/>
                          <ui:param name="propertyLabel" value="Update cycle "/>
                          <ui:param name="propertyPath" value="logevent.updCycle.endDate"/>
                      </ui:include>
                  </f:facet>
                  <h:outputText value="#{_logevent.updCycle.endDate}">
                      <s:convertDateTime pattern="dd.MM.yyyy HH:mm:ss"/>
                  </h:outputText>
              </h:column>
              <h:column rendered="#{s:hasRole('root')}">
                  <f:facet name="header">
                      <ui:include src="layout/sort.xhtml">
                          <ui:param name="entityList" value="#{logeventList}"/>
                          <ui:param name="propertyLabel" value="User"/>
                          <ui:param name="propertyPath" value="logevent.user"/>
                      </ui:include>
                  </f:facet>
                  <h:outputText value="#{_logevent.user}"/>
              </h:column>
              <s:fragment rendered="#{s:hasRole('root')}">
              <rich:column styleClass="action">
                  <f:facet name="header">Action</f:facet>
                  <s:link view="/#{empty from ? 'Logevent' : from}.xhtml"
                         value="#{empty from ? 'View' : 'Select'}"
                   propagation="#{empty from ? 'none' : 'default'}"
                            id="logevent">
                      <f:param name="logeventId"
                              value="#{_logevent.id}"/>
                  </s:link>
                  #{' '}
                  <s:link view="/LogeventEdit.xhtml"
                         value="Edit"
                   propagation="none"
                            id="logeventEdit"
                      rendered="#{s:hasRole('root')}">
                      <f:param name="logeventId"
                              value="#{_logevent.id}"/>
                  </s:link>
              </rich:column>
              </s:fragment>
          </rich:dataTable>
      
          </div>
          </rich:panel>
      
          <div class="tableControl">
      
              <s:button view="/LogeventList.xhtml"
                  rendered="#{logeventList.previousExists}"
                     value="#{messages.left}#{messages.left} First Page"
                        id="firstPage">
                <f:param name="firstResult" value="0"/>
              </s:button>
      
              <s:button view="/LogeventList.xhtml"
                  rendered="#{logeventList.previousExists}"
                     value="#{messages.left} Previous Page"
                        id="previousPage">
                  <f:param name="firstResult"
                          value="#{logeventList.previousFirstResult}"/>
              </s:button>
      
              <s:button view="/LogeventList.xhtml"
                  rendered="#{logeventList.nextExists}"
                     value="Next Page #{messages.right}"
                        id="nextPage">
                  <f:param name="firstResult"
                          value="#{logeventList.nextFirstResult}"/>
              </s:button>
      
              <s:button view="/LogeventList.xhtml"
                  rendered="#{logeventList.nextExists}"
                     value="Last Page #{messages.right}#{messages.right}"
                        id="lastPage">
                  <f:param name="firstResult"
                          value="#{logeventList.lastFirstResult}"/>
              </s:button>
      
          </div>
      
          <s:div styleClass="actionButtons" rendered="#{s:hasRole('root')}">
              <s:button view="/LogeventEdit.xhtml"
                          id="create"
                 propagation="none"
                       value="Create logevent"
                       disabled="#{not s:hasRole('root')}">
                  <f:param name="logeventId"/>
              </s:button>
          </s:div>
      
      </ui:define>
      
      </ui:composition>
      



      LogeventList.page looks like this


      <?xml version="1.0" encoding="UTF-8"?>
      <page xmlns="http://jboss.com/products/seam/pages"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.1.xsd">
         <restrict>#{identity.loggedIn}</restrict>
         <param name="firstResult" value="#{logeventList.firstResult}"/>
         <param name="sort" value="#{logeventList.orderColumn}"/>
         <param name="dir" value="#{logeventList.orderDirection}"/>
      
         <param name="from"/>
         <param name="logMessage" value="#{logeventList.logevent.logMessage}"/>
         <param name="transponderId" value="#{logeventList.logevent.transponderId}"/>
         <param name="user" value="#{logeventList.logevent.user}"/>
         <param name="time" value="#{logeventList.logevent.time}" converterId="org.jboss.seam.ui.DateTimeConverter"/>
         <param name="timeFrom" value="#{logeventList.logevent.timeFrom}" converterId="org.jboss.seam.ui.DateTimeConverter"/>
         <param name="timeTo" value="#{logeventList.logevent.timeTo}" converterId="org.jboss.seam.ui.DateTimeConverter"/>
      
      </page>
      



      Here the java files, respectively EntityBean Logevent.java and LogeventList.java



      @Restrict("#{s:hasRole('admin')}")
      @Entity
      @Table(name = "logevent", catalog = "azobis")
      public class Logevent implements java.io.Serializable {
              
      //      @Logger private Log log;
              
              /**
               * 
               */
              private static final long serialVersionUID = 1L;
      
              public enum Type {
                      ROOM_CHANGED,
                      NOT_FOUND,
                      MISSPLACED,
                      DOOREVENT,
                      REGISTRATION, ERPIMPORT, SYSTEM_STATUS_CHANGE
              }
              
          
      
              private Long id;
              private Date time;
      
              private Date timeFrom;
              private Date timeTo;
              
              private UpdateCycle updCycle;
              private String transponderId;
              private Type type;
              private Equipment equipment;
              private String user;
              private String logMessage;
              
              public Logevent() {
              }
      
              public Logevent(Long id, UpdateCycle updCycle, String uid,
                              Equipment equipment, String user, String logMessage) {
                      super();
                      this.id = id;
                      this.updCycle = updCycle;
                      this.transponderId = uid;
                      this.equipment = equipment;
                      this.user = user;
                      this.logMessage = logMessage;
              }
      
      
              @Id
              @GeneratedValue(strategy = GenerationType.AUTO)
              @Column(name = "Id", unique = true, nullable = false)
              public Long getId() {
                      return id;
              }
      
              public void setId(Long id) {
                      this.id = id;
              }
              
              @ManyToOne(fetch = FetchType.LAZY, optional=true)
              @JoinColumn(name = "updCycleId" )               
              public UpdateCycle getUpdCycle() {
                      return updCycle;
              }
              
              public void setUpdCycle(UpdateCycle updCycle) {
                      this.updCycle = updCycle;
              }
              
              @ManyToOne(fetch = FetchType.LAZY)
              @JoinColumn(name = "equipment" )                
              public Equipment getEquipment() {
                      return this.equipment;
              }
      
              public void setEquipment(Equipment equipment) {
                      this.equipment = equipment;
              }
      
              @Column(name = "username", length = 255)
              public String getUser() {
                      return user;
              }
      
              public void setUser(String user) {
                      this.user = user;
              }
      
              
              @Column(name = "description", length = 512)
              public String getLogMessage() {
                      return logMessage;
              }
      
              public void setLogMessage(String logMessage) {
                      this.logMessage = logMessage;
              }
      
              
              @Column(name = "Uid",  length = 20)
              @Length(max = 20)
              public String getTransponderId() {
                      return this.transponderId;
              }
      
              public void setTransponderId(String uid) {
                      this.transponderId = uid;
              }
      
              @Enumerated(EnumType.STRING)
              @NotNull
              public Type getType() {
                      return type;
              }
      
              public void setType(Type type) {
                      this.type = type;
              }
              
              @Column(name = "timestamp", nullable = false)
              @NotNull
              public Date getTime() {
                      return time;
              }
      
              public void setTime(Date time) {
                      this.time = time;
              }
              
              @Transient
              public Date getTimeFrom() {
                      
                      return timeFrom;
              }
      
              public void setTimeFrom (Date newTime) {
      
                      timeFrom = newTime;
              }
      
              @Transient
              public Date getTimeTo() {
                      
                      return timeTo;
              }
      
              public void setTimeTo (Date newTime) {
      
                      timeTo = newTime;
              }
      
      }
      



      and LogeventList.java


      @Name("logeventList")
      public class LogeventList extends EntityQuery<Logevent> {
      
              
              private static final String EJBQL = "select logevent from Logevent logevent order by logevent.id desc";
      
              
              private static final String[] RESTRICTIONS = {
                              "lower(logevent.logMessage) like concat(lower(#{logeventList.logevent.logMessage}),'%')",
                              "lower(logevent.transponderId) like concat(lower(#{logeventList.logevent.transponderId}),'%')",
                              "lower(logevent.user) like concat(lower(#{logeventList.logevent.user}),'%')",
                      "logevent.time >= #{logeventList.logevent.timeFrom}",
                              "logevent.time <= #{logeventList.logevent.timeTo}"};
              
              
                              
              
              
              private Logevent logevent = new Logevent();
      
              public LogeventList() {
                      setEjbql(EJBQL);
                      setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
                      setMaxResults(25);
      //              setOrder("desc");
              }
      
              public Logevent getLogevent() {
                      return logevent;
              }
      }
      



      And for the End, im useing Jboss 4.2.3.GA , Seam 2.1.1, java 1.6.6 14


      Thanks in advance, and hope to get some help...


      A.K.

        • 1. Re: Porblem filtering by date :S
          gardellajuan

          Pass the param in long format

          • 2. Re: Porblem filtering by date :S
            asdren.k

            Hi!
            First thnx for the reply. But could u elaborate more, what do u mean with that? Do u mean, the time parameter, that i use for filtering, to pass as type LONG instead of DATE? Should i change my EntityBeans as well?


            Thnx ones again!

            • 3. Re: Porblem filtering by date :S
              gardellajuan
              Hi,

              For example in your pages.xml put the param in this form:

              <param name="date" value="#{bean.date.time}"/>


              • 4. Re: Porblem filtering by date :S

                Hi,
                I'm getting the same error


                my code:




                private static final String[] RESTRICTIONS = {"petitions.date  <= #{myEntityList.petitions.date}",};
                
                 <param name="date" value="#{myEntityList.petitions.date}" converterId="onlineDateConverter"/>
                
                
                @Name("onlineDateConverter")
                @org.jboss.seam.annotations.faces.Converter
                @BypassInterceptors
                @Install(precedence = Install.APPLICATION)
                public class OnlineDateConverter extends javax.faces.convert.DateTimeConverter {
                
                   public OnlineDateConverter() {
                        setTimeZone( getTimeZone() );
                        setType("date");
                   }
                
                   @Override
                   public TimeZone getTimeZone() {
                      if ( Contexts.isApplicationContextActive() ) {
                         return org.jboss.seam.international.TimeZone.instance();
                      }
                      else {
                         return TimeZone.getDefault();
                      }
                   }
                } 



                I assume that date parameter is passing correctly as Date, but something going wrong at parsing RESTRICTIONS string



                Caused by: java.lang.NullPointerException
                        at 
                org.hibernate.hql.ast.ParameterTranslationsImpl.getNamedParameterExpectedType(ParameterTranslationsImpl.java:63)



                maybe someone could post an example of working code?


                regards
                Chris




                • 5. Re: Porblem filtering by date :S
                  asdren.k

                  Hi Chris!


                  In my case problem was at the QUERY. I couldn't use order by inside the query and that was the reason throwing the exceptions...


                  regards Asdren

                  • 6. Re: Porblem filtering by date :S

                    Hi,


                    great thanks Asdren!, I had  exactly the same cause.