Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    May 2010
    Messaggi
    457

    Hibernate prelevare anche gli oggetti figli

    Salve a tutti,
    ricordo da molto lontano che per caricare anche i figli di un oggetto bisogna mettere un attibuto lazy o eager .... Qualcuno sa dirmi come fare??


    codice:
    formazioni: Error performing load command
    org.hibernate.exception.SQLGrammarException: could not load an entity: [POJO.Computerdevice#1]
    	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
    	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
    	at org.hibernate.loader.Loader.loadEntity(Loader.java:1874)
    	at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
    	at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
    	at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3044)
    	at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:395)

    Dove va messo Eage? Forse nel reverse engineering?

    codice:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd">
    <hibernate-reverse-engineering>
      <schema-selection match-catalog="vodafoneta"/>
      <table-filter match-name="scheduler"/>
      <table-filter match-name="invalidcode"/>
      <table-filter match-name="ciclo"/>
      <table-filter match-name="esecuzione"/>
      <table-filter match-name="test"/>
      <table-filter match-name="setting"/>
      <table-filter match-name="user"/>
      <table-filter match-name="computerdevice"/>
      <table-filter match-name="ciclotest"/>
      <table-filter match-name="device"/>
      <table-filter match-name="failcode"/>
      <table-filter match-name="sendreport"/>
      <table-filter match-name="grant"/>
      <table-filter match-name="computer"/>
    </hibernate-reverse-engineering>

  2. #2
    Utente di HTML.it
    Registrato dal
    May 2010
    Messaggi
    457
    eppure ho rifatto la query nel modo piu semplice possibile ottenendo la stessa eccezione:

    Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not load an entity: [POJO.Computerdevice#1]


    codice:
     Query query = conn.createSQLQuery(
                 "select * from esecuzione")
                 .addEntity(Esecuzione.class);
               
              
                List result = query.list();
                
                
           return result;

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.