On call to Entityidentifierreaderimpl#resolve, Entitykey was already known; should only happen on root Returns with an optional Identifier specified

Asked

Viewed 212 times

0

Using Hibernate with class:

Java text.

package br.com.meusite.model.documento;

@Entity
public class Texto extends ABeanDao<Texto> {

     private static final long serialVersionUID = 1L;

     private static final int cMaxTamanhoIndice = 2712;

     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     private Long idTexto;

     @Column(nullable = false, columnDefinition = "Text")
     private String textoBruto;

     @Column(nullable = false, columnDefinition = "Text")
     private String idAlternativo;

     @ManyToOne
     @JoinColumn(name = "idTextoAnteriorParteDoTexto", nullable = true)
     @ForeignKey(name = "fk_texto_textoAnteriorParteDoTexto")
     private Texto textoAnteriorParteDoTexto;

     public Texto(){}

     //getters and setters

}

When you make a query with like in the bank through Hibernate I return at the end of the query the following message:

DEBUG ResultSetProcessorImpl:127 - Starting ResultSet row #0
DEBUG EntityReferenceInitializerImpl:142 - On call to EntityIdentifierReaderImpl#resolve, EntityKey was already known; should only happen on root returns with an optional identifier specified
DEBUG TwoPhaseLoad:160 - Resolving associations for [br.com.meusite.model.documento.Texto#265752]
DEBUG TwoPhaseLoad:286 - Done materializing entity [br.com.meusite.model.documento.Texto#265752]
DEBUG TwoPhaseLoad:160 - Resolving associations for [br.com.meusite.model.documento.Texto#265751]

Follow the consultation also.

select * 
 from
    Texto texto0_ 
left outer join
    Texto texto18_ 
        on texto0_.idTextoAnteriorParteDoTexto=texto18_.idTexto 
where
    texto0_.idTexto=?

But it would have to generate a query LIKE(texto0_.idAlternative like ? ) and nottexto0_.idText=?

What is the possible solution to the problem?

  • Post your query as well. Just for this query that gives the error? Any other query (crud) happens the problem?

  • No CRUD happens only that error

  • That’s at least unusual or suspicious: Texto extends ABeanDao<Texto>. What’s in this interface?

  • the interface is just a standard CRUD, are where have the methods of create, delete, Insert and select nothing else, in all other run normal

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.