org.hibernate.MappingException: Could not format discriminator value
Asked on May 19, 2013
Hello Friends,
I am getting below error. I am doing InheritanceType.SINGLE_TABLE.
org.hibernate.MappingException: Could not format discriminator value to SQL string
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:335)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:295)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
Caused by: java.lang.NumberFormatException: For input string:
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.<init>(Unknown Source)
at org.hibernate.type.IntegerType.stringToObject(IntegerType.java:78)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:328)
Replied on May 19, 2013
Caused by: java.lang.NumberFormatException: For input string:
It seems that DiscriminatorType is integer but you are putting @DiscriminatorValue as string.Check the code.