### Error querying database. Cause: java.lang.IllegalArgumentException: invalid comparison: cn.xiaojian.blog.po.BlogType and java.lang.String ### Cause: java.lang.IllegalArgumentException: ...

### Error querying database. Cause: java.lang.IllegalArgumentException: invalid comparison: cn.xiaojian.blog.po.BlogType and java.lang.String
### Cause: java.lang.IllegalArgumentException: invalid comparison: cn.xiaojian.blog.po.BlogType and java.lang.String] with root cause
java.lang.IllegalArgumentException: invalid comparison: cn.xiaojian.blog.po.BlogType and java.lang.String
at org.apache.ibatis.ognl.OgnlOps.compareWithConversion(OgnlOps.java:92)
at org.apache.ibatis.ognl.OgnlOps.isEqual(OgnlOps.java:142)
at org.apache.ibatis.ognl.OgnlOps.equal(OgnlOps.java:794)
at org.apache.ibatis.ognl.ASTNotEq.getValueBody(ASTNotEq.java:53)
at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:258)
at org.apache.ibatis.ognl.ASTAnd.getValueBody(ASTAnd.java:61)
at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:258)
at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:494)
......

  Use the original class as a way of mass participation in the development of MVC habits:

  javaBean:

  

 

 

   Establish extension class on the javaBean:

   

 

 

    Database, there blog blogType table and table foreign key relationships, so the realization blog class, to create a class to do blogType property.

   In this query, the information displayed abnormal seen, invalid comparison: cn.xiaojian.blog.po.BlogType and java.lang.String, can not compare (blogType and String)

 

   Splicing sql statement, to determine whether the class is empty on the line, all the way in front of me did as CV, to the neglect of this error (note that this is simply not a problem).

  So here we pay attention to ah: the code routines deep, CV need to be cautious ah. CV code to pit their own dead ah.

  Daily error ing, learn more lessons, write more elegant code, and hope to help the faithful to the same code is bumpy road.

Guess you like

Origin www.cnblogs.com/jr-xiaojian/p/11605422.html