mybatis / mybatipse

Eclipse plugin adding support for MyBatis SQL Mapper Framework.
Eclipse Public License 1.0
333 stars 92 forks source link

Copy MyBatis Statement fails: Couldn't find the end of the parameters line '<==' #78

Closed lordasti closed 7 years ago

lordasti commented 7 years ago

With the following lines of logging selected:

2017-10-09 11:50:40,728 DEBUG org.apache.ibatis.logging.jdbc.BaseJdbcLogger.debug(BaseJdbcLogger.java:159) - ==> Preparing: INSERT INTO DTP ( DTP_CLA, DTP_NLD, DTP_ARE, DTP_IOP, DTP_OPP, DTP_OVP, DTP_OCT, DTP_EJE, DTP_ORG, DTP_FUN, DTP_ECO, DTP_CTE, DTP_PAM, DTP_CTA, DTP_ENT, DTP_DTO, DTP_SDT, DTP_BSE, DTP_SBS, DTP_PRE, DTP_TIP, DTP_OCN, DTP_OCL, DTP_LDA, DTP_TXT, DTP_EAN, DTP_ENU, DTP_ITE, DTP_EDV, DTP_CSV, DTP_LOR, DTP_CAR, DTP_REI, DTP_REF, DTP_TEX, DTP_LIQ, DTP_BSE1, DTP_TIV1, DTP_PCT1, DTP_IVA1, DTP_BSE2, DTP_TIV2, DTP_PCT2, DTP_IVA2, DTP_BSE3, DTP_TIV3, DTP_PCT3, DTP_IVA3, DTP_GEX, DTP_ENTIDAD, DTP_EJERCICIO ) VALUES ( ?, ?, ?, NULL, ?, NULL, NULL, ?, ?, ?, ?, ' ', ' ', ?, NULL, ?, ?, ?, ?, ?, '1', NULL, NULL, NULL, ?, ?, ?, ?, ?, ?, ?, ?, 'N', '', ?, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ?, ? ) 2017-10-09 11:50:40,748 DEBUG org.apache.ibatis.logging.jdbc.BaseJdbcLogger.debug(BaseJdbcLogger.java:159) - ==> Parameters: 920150009627(Long), 16(Integer), 2(String), 920150000001(Long), 2015(Integer), 00100(String), 01101(String), 31001(String), null, 14.30(BigDecimal), 14.30(BigDecimal), null, null, null, null, null, null, null, null, null, null, null, null, 2015(Integer), 2015(Integer)

after selecting "Copy MyBatis Statement" from the right click menu on the console, eclipse shows "Couldn't find the end of the parameters line '<=='"

I am using MyBatis 3.4.4

harawata commented 7 years ago

MyBatipse looks for the string '<==' in the selection to detect the end of the parameter values.

DEBUG [main] - ==>  Preparing: insert into users values(?, ?) 
DEBUG [main] - ==> Parameters: 2(Integer), User2(String)
DEBUG [main] - <==    Updates: 1

So, you basically need to select one more line in the log. Does this solve your problem?

lordasti commented 7 years ago

Many thanks harawata!!! that was indeed the problem. Is there some source of information or user guide about details such us this?

harawata commented 7 years ago

I have added a note on README and (hopefully) improved the error message. Thank you for the feedback =)