-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: org.hibernate.ObjectNotFoundException: No row with the given
PostPosted: Thu Oct 28, 2010 4:12 pm 
Newbie

Joined: Thu Oct 28, 2010 1:33 pm
Posts: 2
Hi all.

I'm getting this error when the Hibernate try to load an information.
The class has a String id, and seems to have a white space at the end of the UUID.

The full stacktrace:

Quote:
INFO: Error performing load command
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [br.com.accenture.redesignacao.entidades.Participante#ff301d7b-27ed-24d8-cc9b-aff42a33d000 ]
at org.hibernate.impl.SessionFactoryImpl$2.handleEntityNotFound(SessionFactoryImpl.java:449)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:233)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1080)
at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1028)
at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:623)
at org.hibernate.type.EntityType.resolve(EntityType.java:431)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:140)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:898)
at org.hibernate.loader.Loader.doQuery(Loader.java:773)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
at org.hibernate.loader.Loader.doList(Loader.java:2449)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2192)
at org.hibernate.loader.Loader.list(Loader.java:2187)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:119)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1706)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
at br.com.accenture.redesignacao.hibernate.repository.AusenciaDAO.recuperarAusenciasAtivasDe(AusenciaDAO.java:38)
at br.com.accenture.redesignacao.service.Administrativo.recuperarAusenciasAtivasDe(Administrativo.java:67)
at br.com.accenture.redesignacao.test.AdministrativoDeve.recuperarAusenciasAtivasDeParticipante(AdministrativoDeve.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


I appreciate any help. I searched everywhere but I only got examples with Integer/Long IDs and the record did not really exist in the table.

In my case, the record, without white space, exists in table.

Regards.


Top
 Profile  
 
 Post subject: Re: org.hibernate.ObjectNotFoundException: No row with the given
PostPosted: Thu Oct 28, 2010 4:16 pm 
Newbie

Joined: Thu Oct 28, 2010 1:33 pm
Posts: 2
Sorry, my annotated classes:

Code:
package br.com.accenture.redesignacao.entidades;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
* Controla periodos de ausencia de um participante,
* podendo ser temporária ou permanente
* @author Celso Martins
* @since 1.0
*/
@Entity(name="TB_AUSENCIA")
public class Ausencia implements Serializable{

   private static final long serialVersionUID = -3929398142722419L;

   @Id
   @Column(name="ID_AUSENCIA")
   private Long id;
   
   @ManyToOne
   @JoinColumn(name="ID_TIPO_AUSENCIA")
   private TipoAusencia tipoAusencia;
   
   @ManyToOne
   @JoinColumn(name="ID_TIPO_SISTEMA")
   private TipoSistema tipoSistema;
   
   @ManyToOne
   @JoinColumn(name="CRIADO_POR")
   private Participante usuarioSolicitante;
   
   @ManyToOne
   @JoinColumn(name="ID_USUARIO")
   private Participante usuarioOrigem;
   
   @ManyToOne
   @JoinColumn(name="ID_SUBSTITUTO")
   private Participante usuarioDestino;
   
   @Column(name="DATA_INICIAL")
   private Date dataInicial;
   
   @Column(name="DATA_FINAL")
   private Date dataFinal;

   @Column(name="EXECUTADA_EM")
   private Date executadaEm;

...}


Code:
package br.com.accenture.redesignacao.entidades;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Set;
import java.util.TreeSet;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Transient;

/**
* Representa um participante do ALBPM
* @author Celso Martins
* @since 1.0
*/
@Entity(name="DSPERSON")
public class Participante implements Serializable{
   
   private static final long serialVersionUID = 6032468603361536235L;

   @Id
   @Column(name="UUID")
   private String uuid;

   @Column(name="EXTERNALID")
   private Integer id;
   
   @Transient
   private Integer fuegoIn;
   
   @Column(name="DISPLAYNAME")
   private String nome;
   
   @ManyToMany
     @JoinTable(name = "DSUSERINGROUP",
       joinColumns = {@JoinColumn(name="PERSONID")},
       inverseJoinColumns = {@JoinColumn(name="GROUPID")}
     )   
   private Set<Grupo> listaDeGrupos = new TreeSet<Grupo>();
   
   @OneToMany
   @JoinColumn(name="UUID")
   private Set<Ausencia> setDeAusencias = new TreeSet<Ausencia>();
   
   @Transient
   private Set<Participacao> setDeParticipacoes = new TreeSet<Participacao>();
   
...
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.