Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - Generador para tipo de dato Byte no suministrado #48

Closed
jselvamadrigal opened this issue Jun 20, 2020 · 4 comments
Closed

[BUG] - Generador para tipo de dato Byte no suministrado #48

jselvamadrigal opened this issue Jun 20, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@jselvamadrigal
Copy link
Collaborator

Se produce un error durante las pruebas unitarias creadas para el task/47, el error es el siguiente

org.hibernate.id.IdentifierGenerationException: Unknown integral data type for ids : java.lang.Byte
	at org.hibernate.id.IdentifierGeneratorHelper.getIntegralDataTypeHolder(IdentifierGeneratorHelper.java:224)
	at org.hibernate.id.enhanced.TableStructure.makeValue(TableStructure.java:108)
	at org.hibernate.id.enhanced.TableStructure.access$000(TableStructure.java:46)
	at org.hibernate.id.enhanced.TableStructure$1$1.execute(TableStructure.java:129)
	at org.hibernate.id.enhanced.TableStructure$1$1.execute(TableStructure.java:126)
	at org.hibernate.jdbc.WorkExecutor.executeReturningWork(WorkExecutor.java:55)
	at org.hibernate.jdbc.AbstractReturningWork.accept(AbstractReturningWork.java:34)
	at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcIsolationDelegate.delegateWork(JdbcIsolationDelegate.java:57)
	at org.hibernate.id.enhanced.TableStructure$1.getNextValue(TableStructure.java:125)
	at org.hibernate.id.enhanced.PooledOptimizer.generate(PooledOptimizer.java:73)
	at org.hibernate.id.enhanced.SequenceStyleGenerator.generate(SequenceStyleGenerator.java:520)
	at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:120)
	at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:193)
	at org.hibernate.event.internal.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:38)
	at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:178)
	at org.hibernate.event.internal.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:32)
	at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:75)
	at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:108)
	at org.hibernate.internal.SessionImpl.fireSave(SessionImpl.java:618)
	at org.hibernate.internal.SessionImpl.save(SessionImpl.java:611)
	at org.hibernate.internal.SessionImpl.save(SessionImpl.java:606)
	at org.jugni.apps.pico.ModelTest.test(ModelTest.java:30)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

El error indica que se esta un GeneratedValue pero no se esta proporcionando una estrategia para generar un tipo de dato Byte.

@jselvamadrigal jselvamadrigal added the bug Something isn't working label Jun 20, 2020
@jselvamadrigal jselvamadrigal changed the title [BUG] - Generador para tipo de dato Byte no suministrado. [BUG] - Generador para tipo de dato Byte no suministrado Jun 20, 2020
@jselvamadrigal
Copy link
Collaborator Author

Para reproducir el error presentado:

git checkout task/47
mvn -Dtest=TestCuentaTipoDao test -DskipTests=false

@gacsnic
Copy link
Collaborator

gacsnic commented Jun 21, 2020

Se puede corregir el bug, cambiando el tipo de datos de Byte a Short en las tablas que almacenaran pocos registros y así nos ahorramos espacio en memoria.


git flow bugfix start superclassentidad  
mvn -Dtest=ModelTest test -DskipTests=false   

.......
Hibernate: 
    select
        cuentatipo0_.Id as Id1_0_,
        cuentatipo0_.Descripcion as Descripc2_0_ 
    from
        CuentaTipo cuentatipo0_
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 7.615 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  24.480 s
[INFO] Finished at: 2020-06-20T18:26:31-06:00
[INFO] ------------------------------------------------------------------------

`

@berroteran
Copy link
Member

me parece que esto ya está corregido,

@berroteran berroteran changed the title [BUG] - Generador para tipo de dato Byte no suministrado 48 [BUG] - Generador para tipo de dato Byte no suministrado Jun 30, 2020
@jselvamadrigal
Copy link
Collaborator Author

@berroteran si ya se encuentra solucionado

@luchonetvv luchonetvv changed the title 48 [BUG] - Generador para tipo de dato Byte no suministrado [BUG] - Generador para tipo de dato Byte no suministrado Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants