Novo erro hibernate

10 respostas
rocha

Bom dia Pessoal,

Agora não consigo desvendar este erro:

(cfg.Environment                     483 ) Hibernate 2.1.8
(cfg.Environment                     517 ) loaded properties from resource hibernate.properties: 
{hibernate.connection.driver_class=org.firebirdsql.jdbc.FBDriver, 
hibernate.cglib.use_reflection_optimizer=true, hibernate.cache.provider_class=net.sf.hibernate.cache.EhCacheProvider, 
hibernate.cache.use_query_cache=true, hibernate.max_fetch_depth=1, 
hibernate.dialect=net.sf.hibernate.dialect.InterbaseDialect, 
hibernate.jdbc.use_streams_for_binary=true, hibernate.jdbc.batch_size=0,
hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', 
hibernate.proxool.pool_alias=pool1, 
hibernate.connection.username=SYSDBA, 
hibernate.cache.region_prefix=hibernate.test, hibernate.connection.url=
jdbc:firebirdsql://localhost/C:/Arquivos de programas/IBOConsole/MUNDOJAVA, 
hibernate.connection.password=masterkey, hibernate.jdbc.batch_versioned_data=true, hibernate.connection.pool_size=1}
(cfg.Environment                     542 ) using java.io streams to persist binary types
(cfg.Environment                     543 ) using CGLIB reflection optimizer
(cfg.Environment                     572 ) using JDK 1.4 java.sql.Timestamp handling
(cfg.Configuration                   909 ) configuring from resource: /hibernate.cfg.xml
(cfg.Configuration                   881 ) Configuration resource: /hibernate.cfg.xml
(cfg.Configuration                   332 ) Mapping resource: ./hbm/Artista.hbm.xml
(cfg.Binder                          229 ) Mapping class: br.com.mundojava.hibernate.modelo.Artista -> artista
(cfg.Configuration                   332 ) Mapping resource: ./hbm/Capa.hbm.xml
(cfg.Binder                          229 ) Mapping class: br.com.mundojava.hibernate.modelo.Capa -> capa
(cfg.Configuration                   332 ) Mapping resource: ./hbm/Musica.hbm.xml
(cfg.Binder                          229 ) Mapping class: br.com.mundojava.hibernate.modelo.Musica -> musica
(cfg.Configuration                   332 ) Mapping resource: ./hbm/Cd.hbm.xml
(cfg.Binder                          229 ) Mapping class: br.com.mundojava.hibernate.modelo.Cd -> cd
(cfg.Configuration                   1067) Configured SessionFactory: null
(cfg.Configuration                   641 ) processing one-to-many association mappings
(cfg.Binder                          1181) Mapping collection: br.com.mundojava.hibernate.modelo.Artista.cds -> cd
(cfg.Binder                          1181) Mapping collection: br.com.mundojava.hibernate.modelo.Cd.musicas -> musica
(cfg.Configuration                   650 ) processing one-to-one association property references
(cfg.Configuration                   675 ) processing foreign key constraints
(dialect.Dialect                     86  ) Using dialect: net.sf.hibernate.dialect.FirebirdDialect
(cfg.SettingsFactory                 70  ) Maximim outer join fetch depth: 1
(cfg.SettingsFactory                 74  ) Use outer join fetching: true
(connection.DriverManagerConnectionProvider 42  ) Using Hibernate 
built-in connection pool (not for production use!)
(connection.DriverManagerConnectionProvider 43  ) Hibernate connection pool size: 1
(connection.DriverManagerConnectionProvider 77  ) using driver: org.firebirdsql.jdbc.FBDriver at URL:
jdbc:firebirdsql:localhost/3050:C:/Arquivos de programas/IBOConsole/MUNDOJAVA?autoReconnect=true
(connection.DriverManagerConnectionProvider 78  ) connection properties: {user=GESTOR, password=msolutec}
(transaction.TransactionManagerLookupFactory 33  ) No TransactionManagerLookup configured 
(in JTA environment, use of process level read-write cache is not recommended)
(cfg.SettingsFactory                 114 ) Use scrollable result sets: true
(cfg.SettingsFactory                 117 ) Use JDBC3 getGeneratedKeys(): false
(cfg.SettingsFactory                 120 ) Optimize cache for minimal puts: false
(cfg.SettingsFactory                 126 ) echoing all SQL to stdout
(cfg.SettingsFactory                 129 ) Query language substitutions: {no='N', true=1, yes='Y', false=0}
(cfg.SettingsFactory                 140 ) cache provider: net.sf.hibernate.cache.EhCacheProvider
(cfg.SettingsFactory                 152 ) query cache factory: net.sf.hibernate.cache.StandardQueryCacheFactory
(cfg.Configuration                   1130) instantiating and configuring caches
(config.Configurator                 123 ) No configuration found. Configuring 
ehcache from ehcache-failsafe.xml found in the classpath: 
jar:file:/C:/Documents%20and%20Settings/RodrigoR/Meus%20documentos/Hibernate/WEB-INF/lib/ehcache-0.7.jar!/ehcache-failsafe.xml

(impl.SessionFactoryImpl             119 ) building session factory
(impl.SessionFactoryObjectFactory    82  ) Not binding factory to JNDI, no JNDI name configured
(cache.UpdateTimestampsCache         35  ) starting update timestamps cache at region: net.sf.hibernate.cache.UpdateTimestampsCache
(cache.EhCacheProvider               97  ) Could not find configuration [net.sf.hibernate.cache.UpdateTimestampsCache]; using defaults.
(cache.StandardQueryCache            41  ) starting query cache at region: net.sf.hibernate.cache.StandardQueryCache
(cache.EhCacheProvider               97  ) Could not find configuration [net.sf.hibernate.cache.StandardQueryCache]; using defaults.
Hibernate: select cd0_.id as id, cd0_.titulo as titulo, cd0_.artista_id as artista_id from cd cd0_ where (cd0_.artista_id=1 )
(util.JDBCExceptionReporter          57  ) SQL Error: 335544569, SQLState: HY000

(util.JDBCExceptionReporter          58  ) GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -206
Column unknown
CD0_.ARTISTA_ID
At line 1, column 101.
(util.JDBCExceptionReporter          57  ) SQL Error: 335544569, SQLState: HY000
(util.JDBCExceptionReporter          58  ) GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -206
Column unknown
CD0_.ARTISTA_ID
At line 1, column 101.
net.sf.hibernate.exception.GenericJDBCException: Could not execute query

        at net.sf.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:80)
        at net.sf.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:69)
        at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
        at net.sf.hibernate.impl.SessionImpl.convert(SessionImpl.java:4131)
        at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1557)
        at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1531)
        at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1523)
        at br.com.mundojava.hibernate.main.Main.main(Main.java:31)
Caused by: org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -206
Column unknown
CD0_.ARTISTA_ID
At line 1, column 101.
        at org.firebirdsql.jdbc.AbstractPreparedStatement.<init>(AbstractPreparedStatement.java:88)
        at org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:34)
        at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:701)
        at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:232)
        at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:263)
        at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:236)
        at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:67)
        at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:784)
        at net.sf.hibernate.loader.Loader.doQuery(Loader.java:269)
        at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138)
        at net.sf.hibernate.loader.Loader.doList(Loader.java:1063)
        at net.sf.hibernate.loader.Loader.list(Loader.java:1054)
        at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
        at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1554)
        ... 3 more

10 Respostas

C

Olá,

A sua Tabela cd possui uma coluna chamada ARTISTA_ID?

Caused by: org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544569. Dynamic SQL Error
 SQL error code = -206
 Column unknown
 CD0_.ARTISTA_ID
 At line 1, column 101.
rocha

Blz Valeu consegui resolver

Rafael_Nunes

Se parou aí é porque funcionou. O que houve de errado?

edit:Coisa feia, mudando o tópico depois de respondido!! ;o)

rocha

Alguém pode me explicar o q acontece exatamente nessa linha:

List cds = session.find("from Cd as cd where cd.artista.id = 1");
Rafael_Nunes

Dá uma olhada na API do Hibernate, na classe Session.

O método find(String) retorna um objeto List com o resultado da query.

ricardolecheta

[quote=rocha]Alguém pode me explicar o q acontece exatamente nessa linha:

List cds = session.find("from Cd as cd where cd.artista.id = 1");

O Hibernate faz join entre CD e artista… e compara o id do artista para ver se é igual a 1.

rocha

Pessoal agora eu queria saber o seguinte “q vantagem q Maria leva no hibernate se não tenho q escrever sql mas tenho q escrever hql”, idependência de bd?

caiofilipini

rocha:
Pessoal agora eu queria saber o seguinte “q vantagem q Maria leva no hibernate se não tenho q escrever sql mas tenho q escrever hql”, idependência de bd?

Use a Criteria API e seja feliz. :smiley:

[]'s

rocha

caiofilipini:
rocha:
Pessoal agora eu queria saber o seguinte “q vantagem q Maria leva no hibernate se não tenho q escrever sql mas tenho q escrever hql”, idependência de bd?

Use a Criteria API e seja feliz. :smiley:

[]'s

Estou procurando o q é esta API alguém pode me adiantar algo?

caiofilipini

http://www.hibernate.org/hib_docs/api/net/sf/hibernate/Criteria.html
http://www.hibernate.org/hib_docs/reference/en/html/manipulatingdata.html#manipulatingdata-criteria

[]'s

Criado 22 de março de 2005
Ultima resposta 22 de mar. de 2005
Respostas 10
Participantes 5