I am getting the below exception when i run the spring boot application. But the same code works fine when we execute as a plain java.
Exception:
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) Caused by: org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.sample.model.TRSN_LOOKUP.emClntId at org.hibernate.property.access.spi.GetterMethodImpl.get(GetterMethodImpl.java:64) at org.hibernate.tuple.entity.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:230) at org.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:4725)
This is for spring-boot standalone application running in windows
Session session = getSession();
if (!session.getTransaction().isActive() )
session.beginTransaction();
TRSN_LOOKUP trsnlookup = new TRSN_LOOKUP();
trsnlookup.setPrsnid(PrsnId);
trsnlookup.setEmClntId(clientId);
session.save(trsnlookup);
session.getTransaction().commit();
Continuation from my above comments:
Just try with naming-strategy
property which will help you to use a similar name.
For example,: Spring will change entity name from TRSN_LOOKUP
to tRSN_LOOKUP
. So, please try adding one more property in hibernate.
There are two types of strategy, you can use 2nd one:
1. org.hibernate.cfg.ImprovedNamingStrategy
2. org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
which help you keep the same name in all DB fields.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.