itxiaole opened a new issue #3814: Sharding JDBC, errors caused by case, 
database oracle
URL: https://github.com/apache/incubator-shardingsphere/issues/3814
 
 
   #Configuration information:
   
   # shard column name # shard column name
   
spring.shardingsphere.sharding.tables.order_item.table-strategy.inline.sharding-column=order_id
   #Line expressions for the sharding algorithm, with groovy syntax
   
spring.shardingsphere.sharding.tables.order_item.table-strategy.inline.algorithm-expression=order_item_$->{order_id
 % 2 + 1}
   
   #The primary key id
   
spring.shardingsphere.sharding.tables.order_info.key-generator.column=order_id
   #Primary key generation strategy snowflake algorithm
   spring.shardingsphere.sharding.tables.order_info.key-generator.type=SNOWFLAKE
   
   
   #oracle insert
   @Insert("insert into order_info(ORDER_ID,ORDER_PRICE,ORDER_INVENTORY) VALUES 
(#{orderId},#{orderPrice},#{orderInventory})")
   int insert(@Param("orderId")Long orderId, @Param("orderPrice") int 
orderPrice, @Param("orderInventory") int orderInventory);
   
   #error message
   org.mybatis.spring.MyBatisSystemException: nested exception is 
org.apache.ibatis.exceptions.PersistenceException: 
   ### Error updating database.  Cause: java.lang.NullPointerException: Cannot 
invoke method mod() on null object
   ### The error may exist in 
com/sharding/jdbc/jdbc/kuakuguanlianquery/TOrderInfoDao.java (best guess)
   ### The error may involve 
com.sharding.jdbc.jdbc.kuakuguanlianquery.TOrderInfoDao.insert-Inline
   ### The error occurred while setting parameters
   ### SQL: insert into order_info(ORDER_ID,ORDER_PRICE,ORDER_INVENTORY) VALUES 
(?,?,?)
   ### Cause: java.lang.NullPointerException: Cannot invoke method mod() on 
null object
   
   
   #The solution
   @Insert("insert into order_info(order_id,ORDER_PRICE,ORDER_INVENTORY) VALUES 
(#{orderId},#{orderPrice},#{orderInventory})")
   int insert(@Param("orderId")Long orderId, @Param("orderPrice") int 
orderPrice, @Param("orderInventory") int orderInventory);
   
   
   This problem is too pit!! 
   
   
   
    
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to