1
resposta

[Dúvida] Erro JavaPersistence

Exception in thread "main" javax.persistence.PersistenceException: org.hibernate.PropertyAccessException: Null value was assigned to a property [class br.com.alura.alugames.dados.PlanoAssinaturaEntity.percentualDescontoReputacao] of primitive type setter of br.com.alura.alugames.dados.PlanoAssinaturaEntity.percentualDescontoReputacao at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154) at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1626) at org.hibernate.query.internal.AbstractProducedQuery.getSingleResult(AbstractProducedQuery.java:1665) at br.com.alura.alugames.dados.DAO.recuperarPeloId(DAO.kt:25) at br.com.alura.alugames.principal.TesteGamerBancoKt.main(testeGamerBanco.kt:15) at br.com.alura.alugames.principal.TesteGamerBancoKt.main(testeGamerBanco.kt) Caused by: org.hibernate.PropertyAccessException: Null value was assigned to a property [class br.com.alura.alugames.dados.PlanoAssinaturaEntity.percentualDescontoReputacao] of primitive type setter of br.com.alura.alugames.dados.PlanoAssinaturaEntity.percentualDescontoReputacao at org.hibernate.property.access.spi.SetterFieldImpl.set(SetterFieldImpl.java:58) at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:681) at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:144) at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:5242) at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntityFromEntityEntryLoadedState(TwoPhaseLoad.java:253) at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:156) at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:126) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:1201) at org.hibernate.loader.Loader.processResultSet(Loader.java:1009) at org.hibernate.loader.Loader.doQuery(Loader.java:967) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:357) at org.hibernate.loader.Loader.doList(Loader.java:2868) at org.hibernate.loader.Loader.doList(Loader.java:2850) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2682) at org.hibernate.loader.Loader.list(Loader.java:2677) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:540) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400) at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:219) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1443) at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1649) at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1617) ... 4 more Caused by: java.lang.IllegalArgumentException: Can not set final double field br.com.alura.alugames.dados.PlanoAssinaturaEntity.percentualDescontoReputacao to null value at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) at java.base/jdk.internal.reflect.UnsafeQualifiedDoubleFieldAccessorImpl.set(UnsafeQualifiedDoubleFieldAccessorImpl.java:82) at java.base/java.lang.reflect.Field.set(Field.java:799) at org.hibernate.property.access.spi.SetterFieldImpl.set(SetterFieldImpl.java:52) ... 24 more

Esta dando erro no meu codigo e nao estou conseguindo indentificar o que esta acontecendo!

github: https://github.com/allanflm/alu-games
1 resposta

Mandou bem na organização.