Showing posts with label JPA. Show all posts
Showing posts with label JPA. Show all posts

Spring JPA: Dynamic Schema|Table at runtime

named parameter bind only works on the where clause. what if you want different schema at runtime for the table part. such as

'select * from :tablename where ...'  
'update :tablename set ..."

You will find the above won't work in your @Query annotation

use EntityManager::createNativeQuery

You can get the single result, the first result, result lists or result stream.

use entityManager.createNativeQuery(sql).executeUpdate()

use executeUpdate to update or delete records in the table

Not allowed to create transaction on shared EntityManager

Caused by: java.lang.IllegalStateException: Not allowed to create transaction on shared EntityManager - use Spring transactions or EJB CMT instead

Please call joinTransaction before execute update sql

@qzl/typed-i18n — Our Open-Source Typed i18n Project is Gaining Traction

 Hello everyone! πŸ‘‹ We are excited to share an update about one of our open-source projects , @qzl/typed-i18n , created by the QZ-L.com team...