Estou usando o hibernate, e ja tenho uma classe de entidade, e estou usando um método que crie para mim a tabela no banco. O método é este:
public class FabricaTabelaAlunosTec {
public void fabricaAlunoTec(){
try{
AnnotationConfiguration anotaConfig = new AnnotationConfiguration();
anotaConfig.addAnnotatedClass(AlunosTec.class);
new SchemaExport(anotaConfig).create(true, true);
}
catch (Exception e){
e.printStackTrace();
}
}
}
Em seguida, eu já tento gravar dados na tabela, e o erro que eu estou tendo é este:
Caused by: org.apache.derby.client.am.SqlException: A tabela/visão ‘ALUNOSTEC_TESTE’ não existe.
at org.apache.derby.client.am.Statement.completeSqlca(Unknown Source)
at org.apache.derby.client.net.NetStatementReply.parsePrepareError(Unknown Source)
at org.apache.derby.client.net.NetStatementReply.parsePRPSQLSTTreply(Unknown Source)
at org.apache.derby.client.net.NetStatementReply.readPrepareDescribeOutput(Unknown Source)
at org.apache.derby.client.net.StatementReply.readPrepareDescribeOutput(Unknown Source)
O que este erro quer dizer, e como eu posso resolve-lo???
INFO: Not binding factory to JNDI, no JNDI name configured
org.hibernate.MappingException: Unknown entity: entity.ProductCode
at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:550)
at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1338)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:98)
[quote=Jefries]Não, não e esse o erro, continuo não gravando…
tenho este erro insuportável agora:
INFO: Not binding factory to JNDI, no JNDI name configured
org.hibernate.MappingException:[color=red] Unknown entity: entity.ProductCode[/color]
at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:550)
at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1338)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:98)