What's wrong with using jpa for one project but using native sql for all?

clipboard.png

A project is all native sql like this. Ah,

Mar.16,2021

it's okay to use sql in some scenarios, but if you use it all, why not use a lighter framework? For example, mybatis


is fine, but at most it is troublesome. Paste and copy.


so hard-code in the code. It's very invasive.

  1. if you need to change the sql. The source code must be modified.
  2. after modification, you must also republish
  3. is highly coupled, mixing sql and java code together. Poor readability
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e62e77-459e0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e62e77-459e0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?