Pessoal,
Depois de dar uma vasculhada pela net, substitui a linha import org.hibernate.annotations.Entity por import javax.persistence.Entity. Ele começou a funcionar, mas agora, estou tendo o problema por exemplo com a classe abaixo (Isso esta ocorrendo com algumas classes).
Se alguém puder ajudar, agradeço.
Abs,
[code]package br.com.scn.bean;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Entity;
@Entity
@Table(name=“tbl_atvid”)
public class Atividade {
@Id
@GeneratedValue
private Long id;
private String nome;
private String desc;
private Long id_cod;
private Long id_vlr;
private Long id_tp_cbrc;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public Long getId_cod() {
return id_cod;
}
public void setId_cod(Long id_cod) {
this.id_cod = id_cod;
}
public Long getId_vlr() {
return id_vlr;
}
public void setId_vlr(Long id_vlr) {
this.id_vlr = id_vlr;
}
public Long getId_tp_cbrc() {
return id_tp_cbrc;
}
public void setId_tp_cbrc(Long id_tp_cbrc) {
this.id_tp_cbrc = id_tp_cbrc;
}
}
[/code]
19:41:11,648 INFO Version:15 - Hibernate Annotations 3.3.1.GA
19:41:11,697 INFO Environment:500 - Hibernate 3.2.0
19:41:11,705 INFO Environment:518 - loaded properties from resource hibernate.properties: {hibernate.bytecode.use_reflection_optimizer=false}
19:41:11,707 INFO Environment:667 - Bytecode provider name : cglib
19:41:11,715 INFO Environment:584 - using JDK 1.4 java.sql.Timestamp handling
19:41:11,866 INFO Configuration:1350 - configuring from resource: /hibernate.cfg.xml
19:41:11,867 INFO Configuration:1327 - Configuration resource: /hibernate.cfg.xml
19:41:12,082 INFO Configuration:1465 - Configured SessionFactory: null
19:41:12,114 INFO Dialect:141 - Using dialect: org.hibernate.dialect.MySQLDialect
19:41:12,392 INFO AnnotationBinder:418 - Binding entity from annotated class: br.com.scn.bean.Auditoria
19:41:12,475 INFO EntityBinder:424 - Bind entity br.com.scn.bean.Auditoria on table tbl_audt
19:41:12,559 INFO AnnotationBinder:418 - Binding entity from annotated class: br.com.scn.bean.Atividade
19:41:12,560 INFO EntityBinder:424 - Bind entity br.com.scn.bean.Atividade on table tbl_atvid
19:41:12,563 INFO AnnotationBinder:418 - Binding entity from annotated class: br.com.scn.bean.Codigos
19:41:12,564 INFO EntityBinder:424 - Bind entity br.com.scn.bean.Codigos on table tbl_codgs
19:41:12,578 INFO Version:17 - Hibernate Validator 3.0.0.GA
19:41:12,676 INFO SchemaExport:154 - Running hbm2ddl schema export
19:41:12,677 INFO SchemaExport:179 - exporting generated schema to database
19:41:12,683 INFO C3P0ConnectionProvider:50 - C3P0 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/scn
19:41:12,684 INFO C3P0ConnectionProvider:51 - Connection properties: {user=root_scn, password=****}
19:41:12,684 INFO C3P0ConnectionProvider:54 - autocommit mode: false
drop table if exists tbl_atvid
19:41:13,609 DEBUG SchemaExport:303 -
drop table if exists tbl_atvid
19:41:13,624 WARN JDBCExceptionReporter:48 - SQL Warning: 1051, SQLState: 42S02
19:41:13,624 WARN JDBCExceptionReporter:49 - Unknown table ‘tbl_atvid’
drop table if exists tbl_audt
19:41:13,624 DEBUG SchemaExport:303 -
drop table if exists tbl_audt
19:41:13,625 WARN JDBCExceptionReporter:48 - SQL Warning: 1051, SQLState: 42S02
19:41:13,626 WARN JDBCExceptionReporter:49 - Unknown table ‘tbl_atvid’
drop table if exists tbl_codgs
19:41:13,626 DEBUG SchemaExport:303 -
drop table if exists tbl_codgs
19:41:13,629 WARN JDBCExceptionReporter:48 - SQL Warning: 1051, SQLState: 42S02
19:41:13,629 WARN JDBCExceptionReporter:49 - Unknown table 'tbl_atvid’
19:41:13,630 WARN JDBCExceptionReporter:48 - SQL Warning: 1051, SQLState: 42S02
19:41:13,630 WARN JDBCExceptionReporter:49 - Unknown table ‘tbl_codgs’
create table tbl_atvid (
id bigint not null auto_increment,
desc varchar(255),
id_cod bigint,
id_tp_cbrc bigint,
id_vlr bigint,
nome varchar(255),
primary key (id)
)
19:41:13,631 DEBUG SchemaExport:303 -
create table tbl_atvid (
id bigint not null auto_increment,
desc varchar(255),
id_cod bigint,
id_tp_cbrc bigint,
id_vlr bigint,
nome varchar(255),
primary key (id)
)
19:41:13,652 ERROR SchemaExport:274 - Unsuccessful: create table tbl_atvid (id bigint not null auto_increment, desc varchar(255), id_cod bigint, id_tp_cbrc bigint, id_vlr bigint, nome varchar(255), primary key (id))
19:41:13,652 ERROR SchemaExport:275 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘desc varchar(255), id_cod bigint, id_tp_cbrc bigint, id_vlr bigint, nome varchar’ at line 1
create table tbl_audt (
id bigint not null auto_increment,
evento varchar(255),
hr_fm datetime,
hr_inic datetime,
id_login bigint,
ip_cpt bigint,
tp_evento varchar(255),
primary key (id)
)
19:41:13,653 DEBUG SchemaExport:303 -
create table tbl_audt (
id bigint not null auto_increment,
evento varchar(255),
hr_fm datetime,
hr_inic datetime,
id_login bigint,
ip_cpt bigint,
tp_evento varchar(255),
primary key (id)
)
19:41:13,659 WARN JDBCExceptionReporter:48 - SQL Warning: 1051, SQLState: 42S02
19:41:13,659 WARN JDBCExceptionReporter:49 - Unknown table 'tbl_atvid’
19:41:13,660 WARN JDBCExceptionReporter:48 - SQL Warning: 1051, SQLState: 42S02
19:41:13,661 WARN JDBCExceptionReporter:49 - Unknown table ‘tbl_codgs’
create table tbl_codgs (
id bigint not null auto_increment,
desc varchar(255),
nome varchar(255),
primary key (id)
)
19:41:13,661 DEBUG SchemaExport:303 -
create table tbl_codgs (
id bigint not null auto_increment,
desc varchar(255),
nome varchar(255),
primary key (id)
)
19:41:13,663 ERROR SchemaExport:274 - Unsuccessful: create table tbl_codgs (id bigint not null auto_increment, desc varchar(255), nome varchar(255), primary key (id))
19:41:13,663 ERROR SchemaExport:275 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘desc varchar(255), nome varchar(255), primary key (id))’ at line 1
19:41:13,664 INFO SchemaExport:238 - Executing import script: /import.sql
19:41:13,665 INFO SchemaExport:196 - schema export complete