Olá,
não sei mas o que fazer pois estou tentando fazer
onetomany mas na tabela a fk criada fk_id_nota
fica nulo e não dá erro o que está acontecendo alguém poderia me dar um help
pois já estou uma semana …hele…help
abs
public class TesteNF {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
//BasicConfigurator.configure();
//Logger.getLogger("org").setLevel(Level.ERROR);
System.out.println("Inicio...");
// TODO Auto-generated method stub
org.apache.log4j.BasicConfigurator.configure();
System.out.println("Inicio...");
NFDAO nfDAO = new NFDAO();
NotaFiscal n = new NotaFiscal();
n.setNome("Nota Fiscal 2 I");
NFItem item1 = new NFItem();
item1.setQtdeItem(10);
item1.setSeqItem(01);
NFItem item2 = new NFItem();
item2.setQtdeItem(1000);
item2.setSeqItem(02);
n.setItenss(new HashSet<NFItem>());
n.getItenss().add(item1);
n.getItenss().add(item2);
nfDAO.inserirNF(n);
System.out.println("Gravação ok....");
}
}
---
import java.util.Collection;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name="Nota_Fiscal")
public class NotaFiscal {
@Id
@GeneratedValue
@Column(name="id_nota")
private int id;
@Column(name="nome")
private String nome;
@OneToMany(targetEntity=NFItem.class ,mappedBy="nota",fetch=FetchType.EAGER, cascade =javax.persistence.CascadeType.ALL)
private Collection<NFItem> itenss ;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public Collection<NFItem> getItenss() {
return itenss;
}
public void setItenss(Collection<NFItem> itenss) {
this.itenss = itenss;
}
}
---
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table( name="Nota_Fiscal_Item")
public class NFItem {
@Id
@GeneratedValue
@Column(name="id_item")
private int id;
@Column
private int seqItem;
@Column
private int qtdeItem;
@ManyToOne(fetch = FetchType.EAGER,targetEntity=NotaFiscal.class)
@JoinColumn(name="fk_id_nota")
private NotaFiscal nota;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getSeqItem() {
return seqItem;
}
public void setSeqItem(int seqItem) {
this.seqItem = seqItem;
}
public int getQtdeItem() {
return qtdeItem;
}
public void setQtdeItem(int qtdeItem) {
this.qtdeItem = qtdeItem;
}
public NotaFiscal getNota() {
return nota;
}
public void setNota(NotaFiscal nota) {
this.nota = nota;
}
}
------
public class NotaFiscalBusiness {
NFDAO nfDAO = null;
/**
* Inserir usuário
*/
public void inserirUsuario(NotaFiscal nf) {
nfDAO = new NFDAO();
nfDAO.inserirNF(nf);
}
----
*/
public class NFDAO {
private EntityManagerFactory factory = null;
private EntityManager manager = null;
public NFDAO() {
factory = Persistence.createEntityManagerFactory("JPA9");
manager = factory.createEntityManager();
}
/**
* Inserindo um NF
*
* @param universidade
*/
public void inserirNF(NotaFiscal nf) {
EntityTransaction transaction = manager.getTransaction();
try {
transaction.begin();
manager.persist(nf);
transaction.commit();
manager.close();
System.out.println("Inclusão OK...");
} catch (Exception e) {
transaction.rollback();
System.err.println("Erro: " + e.getMessage());
} finally {
}
}
-------
Inicio...
Inicio...
0 [main] INFO org.hibernate.cfg.annotations.Version - Hibernate Annotations 3.3.1.GA
47 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.2.6
63 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
63 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : cglib
94 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
313 [main] INFO org.hibernate.ejb.Version - Hibernate EntityManager 3.3.2.GA
392 [main] DEBUG org.hibernate.ejb.Ejb3Configuration - Look up for persistence unit: JPA9
626 [main] DEBUG org.hibernate.util.DTDEntityResolver - trying to resolve system-id [http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd]
626 [main] DEBUG org.hibernate.cfg.EJB3DTDEntityResolver - recognized EJB3 ORM namespace; attempting to resolve on classpath under org/hibernate/ejb
626 [main] DEBUG org.hibernate.cfg.EJB3DTDEntityResolver - located [http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd] in classpath
940 [main] DEBUG org.hibernate.ejb.Ejb3Configuration - Detect class: true; detect hbm: true
971 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Searching mapped entities in jar/par: file:/C:/workspace/TesteJPA/build/classes/
971 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.exception.DAOException
1080 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.exception.TrataErroException
1112 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.modelo.Centro
1174 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.modelo.NFItem
1174 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Java element filter matched for br.com.exemplojpa.modelo.NFItem
1190 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.modelo.NotaFiscal
1190 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Java element filter matched for br.com.exemplojpa.modelo.NotaFiscal
1190 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.modelo.Universidade
1190 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.modelo.Usuario
1190 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Java element filter matched for br.com.exemplojpa.modelo.Usuario
1237 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.modelo.Usuario1
1425 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Java element filter matched for br.com.exemplojpa.modelo.Usuario1
1425 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.negocio.ExceptionBusiness
1425 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.negocio.NotaFiscalBusiness
1425 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.negocio.UsuarioBusiness
1425 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.persistencia.ExceptionDAO
1440 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.persistencia.GeraBanco
1440 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.persistencia.NFDAO
1440 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.persistencia.UniversidadeDAO
1440 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.persistencia.UsuarioDAO
1456 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.teste.GeraTabelas
1456 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.teste.Teste
1456 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.teste.TesteException
1456 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.teste.TesteExemploJPA
1472 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.teste.TesteNF
1472 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - Filtering: br.com.exemplojpa.teste.TesteUniversidade
1472 [main] DEBUG org.hibernate.ejb.packaging.AbstractJarVisitor - File Filter matched for META-INF/orm.xml
1472 [main] DEBUG org.hibernate.ejb.Ejb3Configuration - Detect class: true; detect hbm: true
1472 [main] DEBUG org.hibernate.ejb.Ejb3Configuration - Creating Factory: JPA9
1597 [main] DEBUG org.hibernate.util.DTDEntityResolver - trying to resolve system-id [file:///C:/workspace/TesteJPA/orm_1_0.xsd]
1597 [main] DEBUG org.hibernate.cfg.EJB3DTDEntityResolver - recognized EJB3 ORM namespace; attempting to resolve on classpath under org/hibernate/ejb
1628 [main] DEBUG org.hibernate.cfg.EJB3DTDEntityResolver - located [file:///C:/workspace/TesteJPA/orm_1_0.xsd] in classpath
1863 [main] DEBUG org.hibernate.cfg.AnnotationConfiguration - Execute first pass mapping processing
2129 [main] DEBUG org.hibernate.cfg.AnnotationConfiguration - Process hbm files
2129 [main] DEBUG org.hibernate.cfg.AnnotationConfiguration - Process annotated classes
2145 [main] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: br.com.exemplojpa.modelo.Usuario
2207 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column DTYPE unique false
2254 [main] DEBUG org.hibernate.cfg.annotations.EntityBinder - Import with entity name=Usuario
2270 [main] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity br.com.exemplojpa.modelo.Usuario on table Usuario
2286 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing br.com.exemplojpa.modelo.Usuario property annotation
2333 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing br.com.exemplojpa.modelo.Usuario field annotation
2380 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing annotations of br.com.exemplojpa.modelo.Usuario.id
2380 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column id unique false
2380 [main] DEBUG org.hibernate.cfg.AnnotationBinder - id is an id
2395 [main] DEBUG org.hibernate.cfg.annotations.SimpleValueBinder - building SimpleValue for id
2395 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - Building property id
2411 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Bind @Id on id
2411 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing annotations of br.com.exemplojpa.modelo.Usuario.login
2411 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column login unique false
2411 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - binding property login with lazy=false
2411 [main] DEBUG org.hibernate.cfg.annotations.SimpleValueBinder - building SimpleValue for login
2411 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - Building property login
2411 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing annotations of br.com.exemplojpa.modelo.Usuario.nome
2411 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column nome unique false
2411 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - binding property nome with lazy=false
2411 [main] DEBUG org.hibernate.cfg.annotations.SimpleValueBinder - building SimpleValue for nome
2411 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - Building property nome
2411 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing annotations of br.com.exemplojpa.modelo.Usuario.password
2411 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column password unique false
2411 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - binding property password with lazy=false
2411 [main] DEBUG org.hibernate.cfg.annotations.SimpleValueBinder - building SimpleValue for password
2411 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - Building property password
2427 [main] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: br.com.exemplojpa.modelo.Usuario1
2427 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column DTYPE unique false
2427 [main] DEBUG org.hibernate.cfg.annotations.EntityBinder - Import with entity name=Usuario1
2427 [main] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity br.com.exemplojpa.modelo.Usuario1 on table Usuario1
2427 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing br.com.exemplojpa.modelo.Usuario1 property annotation
2427 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing br.com.exemplojpa.modelo.Usuario1 field annotation
2442 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing annotations of br.com.exemplojpa.modelo.Usuario1.id
2442 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column id unique false
2442 [main] DEBUG org.hibernate.cfg.AnnotationBinder - id is an id
2442 [main] DEBUG org.hibernate.cfg.annotations.SimpleValueBinder - building SimpleValue for id
2442 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - Building property id
2442 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Bind @Id on id
2442 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing annotations of br.com.exemplojpa.modelo.Usuario1.login
2442 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column login unique false
2442 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - binding property login with lazy=false
2442 [main] DEBUG org.hibernate.cfg.annotations.SimpleValueBinder - building SimpleValue for login
2442 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - Building property login
2442 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing annotations of br.com.exemplojpa.modelo.Usuario1.nome
2442 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column nome unique false
2442 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - binding property nome with lazy=false
2442 [main] DEBUG org.hibernate.cfg.annotations.SimpleValueBinder - building SimpleValue for nome
2442 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - Building property nome
2442 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing annotations of br.com.exemplojpa.modelo.Usuario1.password
2442 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column password unique false
2442 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - binding property password with lazy=false
2442 [main] DEBUG org.hibernate.cfg.annotations.SimpleValueBinder - building SimpleValue for password
2442 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - Building property password
2442 [main] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: br.com.exemplojpa.modelo.NFItem
2442 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column DTYPE unique false
2442 [main] DEBUG org.hibernate.cfg.annotations.EntityBinder - Import with entity name=NFItem
2442 [main] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity br.com.exemplojpa.modelo.NFItem on table Nota_Fiscal_Item
2489 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing br.com.exemplojpa.modelo.NFItem property annotation
2489 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing br.com.exemplojpa.modelo.NFItem field annotation
2489 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing annotations of br.com.exemplojpa.modelo.NFItem.id
2489 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column id_item unique false
2489 [main] DEBUG org.hibernate.cfg.AnnotationBinder - id is an id
2489 [main] DEBUG org.hibernate.cfg.annotations.SimpleValueBinder - building SimpleValue for id
2489 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - Building property id
2489 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Bind @Id on id
2489 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing annotations of br.com.exemplojpa.modelo.NFItem.nota
2505 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column fk_id_nota unique false
2505 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column nota unique false
2568 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - Building property nota
2568 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing annotations of br.com.exemplojpa.modelo.NFItem.qtdeItem
2568 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column qtdeItem unique false
2568 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - binding property qtdeItem with lazy=false
2568 [main] DEBUG org.hibernate.cfg.annotations.SimpleValueBinder - building SimpleValue for qtdeItem
2568 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - Building property qtdeItem
2568 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing annotations of br.com.exemplojpa.modelo.NFItem.seqItem
2568 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column seqItem unique false
2568 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - binding property seqItem with lazy=false
2568 [main] DEBUG org.hibernate.cfg.annotations.SimpleValueBinder - building SimpleValue for seqItem
2568 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - Building property seqItem
2568 [main] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: br.com.exemplojpa.modelo.NotaFiscal
2568 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column DTYPE unique false
2568 [main] DEBUG org.hibernate.cfg.annotations.EntityBinder - Import with entity name=NotaFiscal
2568 [main] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity br.com.exemplojpa.modelo.NotaFiscal on table Nota_Fiscal
2568 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing br.com.exemplojpa.modelo.NotaFiscal property annotation
2583 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing br.com.exemplojpa.modelo.NotaFiscal field annotation
2599 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing annotations of br.com.exemplojpa.modelo.NotaFiscal.id
2599 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column id_nota unique false
2599 [main] DEBUG org.hibernate.cfg.AnnotationBinder - id is an id
2599 [main] DEBUG org.hibernate.cfg.annotations.SimpleValueBinder - building SimpleValue for id
2599 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - Building property id
2599 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Bind @Id on id
2599 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing annotations of br.com.exemplojpa.modelo.NotaFiscal.itenss
2599 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column null unique false
2599 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column itenss unique false
2599 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column null unique false
2661 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column element unique false
2661 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column mapkey unique false
2661 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column null unique false
2661 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column null unique false
2661 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column null unique false
2661 [main] DEBUG org.hibernate.cfg.annotations.CollectionBinder - Collection role: br.com.exemplojpa.modelo.NotaFiscal.itenss
2677 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - Building property itenss
2677 [main] DEBUG org.hibernate.cfg.AnnotationBinder - Processing annotations of br.com.exemplojpa.modelo.NotaFiscal.nome
2677 [main] DEBUG org.hibernate.cfg.Ejb3Column - Binding column nome unique false
2677 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - binding property nome with lazy=false
2677 [main] DEBUG org.hibernate.cfg.annotations.SimpleValueBinder - building SimpleValue for nome
2677 [main] DEBUG org.hibernate.cfg.annotations.PropertyBinder - Building property nome
2677 [main] DEBUG org.hibernate.cfg.AnnotationConfiguration - processing fk mappings (*ToOne and JoinedSubclass)
2912 [main] DEBUG org.hibernate.cfg.Configuration - processing extends queue
2912 [main] DEBUG org.hibernate.cfg.Configuration - processing collection mappings
2912 [main] DEBUG org.hibernate.cfg.CollectionSecondPass - Second pass for collection: br.com.exemplojpa.modelo.NotaFiscal.itenss
2928 [main] DEBUG org.hibernate.cfg.annotations.CollectionBinder - Binding a OneToMany: br.com.exemplojpa.modelo.NotaFiscal.itenss through a foreign key
2928 [main] INFO org.hibernate.cfg.annotations.CollectionBinder - Mapping collection: br.com.exemplojpa.modelo.NotaFiscal.itenss -> Nota_Fiscal_Item
2928 [main] DEBUG org.hibernate.cfg.annotations.TableBinder - Retrieving property br.com.exemplojpa.modelo.NFItem.nota
2928 [main] DEBUG org.hibernate.cfg.CollectionSecondPass - Mapped collection key: fk_id_nota, one-to-many: br.com.exemplojpa.modelo.NFItem
2928 [main] DEBUG org.hibernate.cfg.Configuration - processing native query and ResultSetMapping mappings
2928 [main] DEBUG org.hibernate.cfg.Configuration - processing association property references
2928 [main] DEBUG org.hibernate.cfg.Configuration - processing foreign key constraints
2928 [main] DEBUG org.hibernate.cfg.Configuration - resolving reference to class: br.com.exemplojpa.modelo.NotaFiscal
2975 [main] INFO org.hibernate.validator.Version - Hibernate Validator 3.0.0.GA
2975 [main] DEBUG org.hibernate.validator.ClassValidator - ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
3021 [main] DEBUG org.hibernate.validator.ClassValidator - ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
3021 [main] DEBUG org.hibernate.validator.ClassValidator - ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
3037 [main] DEBUG org.hibernate.validator.ClassValidator - ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
3115 [main] DEBUG org.hibernate.ejb.util.NamingHelper - No JNDI name configured for binding Ejb3Configuration
3178 [main] DEBUG org.hibernate.cfg.Configuration - Preparing to build session factory with filters : {}
3178 [main] DEBUG org.hibernate.cfg.AnnotationConfiguration - Execute first pass mapping processing
3178 [main] DEBUG org.hibernate.cfg.AnnotationConfiguration - Process hbm files
3178 [main] DEBUG org.hibernate.cfg.AnnotationConfiguration - Process annotated classes
3178 [main] DEBUG org.hibernate.cfg.AnnotationConfiguration - processing fk mappings (*ToOne and JoinedSubclass)
3178 [main] DEBUG org.hibernate.cfg.Configuration - processing extends queue
3178 [main] DEBUG org.hibernate.cfg.Configuration - processing collection mappings
3178 [main] DEBUG org.hibernate.cfg.Configuration - processing native query and ResultSetMapping mappings
3178 [main] DEBUG org.hibernate.cfg.Configuration - processing association property references
3178 [main] DEBUG org.hibernate.cfg.Configuration - processing foreign key constraints
3178 [main] DEBUG org.hibernate.cfg.Configuration - resolving reference to class: br.com.exemplojpa.modelo.NotaFiscal
3178 [main] DEBUG org.hibernate.validator.ClassValidator - ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
3178 [main] DEBUG org.hibernate.validator.ClassValidator - ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
3194 [main] DEBUG org.hibernate.validator.ClassValidator - ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
3194 [main] DEBUG org.hibernate.validator.ClassValidator - ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
3241 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
3241 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 20
3241 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: true
3241 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/exemplojpa
3272 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=root, password=root, autocommit=true, release_mode=auto}
3272 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - opening new JDBC connection
3788 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - created connection to: jdbc:mysql://localhost:3306/exemplojpa, Isolation Level: 4
3788 [main] INFO org.hibernate.cfg.SettingsFactory - RDBMS: MySQL, version: 5.0.67-community-nt
3788 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.0-beta ( $Date: 2005-11-17 16:14:47 +0100 (Thu, 17 Nov 2005) $, $Revision$ )
3867 [main] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.MySQLDialect
3867 [main] INFO org.hibernate.transaction.TransactionFactoryFactory - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
3882 [main] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
3882 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
3882 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
3882 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
3882 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
3882 [main] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
3882 [main] DEBUG org.hibernate.cfg.SettingsFactory - Wrap result sets: disabled
3882 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled
3882 [main] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto
3882 [main] INFO org.hibernate.cfg.SettingsFactory - Maximum outer join fetch depth: 2
3882 [main] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
3882 [main] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
3882 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
3882 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
3882 [main] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
3898 [main] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
3898 [main] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
3898 [main] INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: enabled
3898 [main] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
3898 [main] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
3898 [main] INFO org.hibernate.cfg.SettingsFactory - Cache provider: org.hibernate.cache.NoCacheProvider
3898 [main] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
3898 [main] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
3929 [main] INFO org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
3929 [main] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
3929 [main] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
3929 [main] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
3929 [main] INFO org.hibernate.cfg.SettingsFactory - Named query checking : enabled
4023 [main] DEBUG org.hibernate.validator.ClassValidator - ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
4023 [main] DEBUG org.hibernate.validator.ClassValidator - ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
4023 [main] DEBUG org.hibernate.validator.ClassValidator - ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
4023 [main] DEBUG org.hibernate.validator.ClassValidator - ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
4039 [main] INFO org.hibernate.search.Version - Hibernate Search 3.0.1.GA
4227 [main] INFO org.hibernate.impl.SessionFactoryImpl - building session factory
4227 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - Session factory constructed with filter configurations : {}
4227 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - instantiating session factory with properties: {java.runtime.name=Java(TM) SE Runtime Environment, hibernate.connection.password=root, sun.boot.library.path=C:\Arquivos de programas\Java\jre1.6.0_04\bin, java.vm.version=10.0-b19, hibernate.connection.username=root, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=BR, sun.java.launcher=SUN_STANDARD, sun.os.patch.level=Service Pack 2, hibernate.archive.autodetetion=class, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\workspace\TesteJPA, java.runtime.version=1.6.0_04-b12, hibernate.ejb.discard_pc_on_close=false, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=C:\Arquivos de programas\Java\jre1.6.0_04\lib\endorsed, os.arch=x86, hibernate.connection.autocommit=true, java.io.tmpdir=C:\DOCUME~1\pribeiro\CONFIG~1\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows XP, sun.jnu.encoding=Cp1252, java.library.path=C:\Arquivos de programas\Java\jre1.6.0_04\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Arquivos de programas/Java/jre1.6.0_04/bin/client;C:/Arquivos de programas/Java/jre1.6.0_04/bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Arquivos de programas\Arquivos comuns\Aladdin Shared\eToken\PKIClient\x32;C:\Arquivos de programas\TortoiseSVN\bin, java.specification.name=Java Platform API Specification, java.class.version=50.0, sun.management.compiler=HotSpot Client Compiler, hibernate.transaction.factory_class=org.hibernate.transaction.JDBCTransactionFactory, os.version=5.1, user.home=C:\Documents and Settings\pribeiro, user.timezone=, java.awt.printerjob=sun.awt.windows.WPrinterJob, hibernate.connection.release_mode=auto, java.specification.version=1.6, file.encoding=Cp1252, hibernate.format_sql=true, hibernate.connection.driver_class=com.mysql.jdbc.Driver, java.class.path=C:\workspace\TesteJPA\build\classes;C:\workspace\TesteJPA\lib\xwork-2.0.4.jar;C:\workspace\TesteJPA\lib\ant-antlr-1.6.5.jar;C:\workspace\TesteJPA\lib\asm.jar;C:\workspace\TesteJPA\lib\asm-attrs.jar;C:\workspace\TesteJPA\lib\aspectjrt.jar;C:\workspace\TesteJPA\lib\aspectjweaver.jar;C:\workspace\TesteJPA\lib\c3p0-0.9.1.jar;C:\workspace\TesteJPA\lib\cglib-2.1.3.jar;C:\workspace\TesteJPA\lib\commons-beanutils-1.6.jar;C:\workspace\TesteJPA\lib\commons-collections-2.1.1.jar;C:\workspace\TesteJPA\lib\commons-logging-1.1.jar;C:\workspace\TesteJPA\lib\commons-validator-1.3.0.jar;C:\workspace\TesteJPA\lib\dom4j-1.6.1.jar;C:\workspace\TesteJPA\lib\ejb3-persistence.jar;C:\workspace\TesteJPA\lib\hibernate3.jar;C:\workspace\TesteJPA\lib\hibernate-annotations.jar;C:\workspace\TesteJPA\lib\hibernate-commons-annotations.jar;C:\workspace\TesteJPA\lib\hibernate-entitymanager.jar;C:\workspace\TesteJPA\lib\hibernate-search.jar;C:\workspace\TesteJPA\lib\hibernate-validator.jar;C:\workspace\TesteJPA\lib\javassist.jar;C:\workspace\TesteJPA\lib\jta.jar;C:\workspace\TesteJPA\lib\log4j-1.2.15.jar;C:\workspace\TesteJPA\lib\lucene-core-2.3.2.jar;C:\workspace\TesteJPA\lib\mysql-connector-java-5.0.0-beta-bin.jar;C:\workspace\TesteJPA\lib\ognl-2.6.11.jar;C:\workspace\TesteJPA\lib\ojdbc14.jar;C:\workspace\TesteJPA\lib\spring.jar;C:\workspace\TesteJPA\lib\struts2-sitemesh-plugin-2.0.11.1.jar;C:\workspace\TesteJPA\lib\struts2-spring-plugin-2.0.11.1.jar;C:\workspace\TesteJPA\lib\antlr-2.7.5H3.jar, user.name=pribeiro, hibernate.bytecode.use_reflection_optimizer=false, hibernate.show_sql=true, hibernate.use_identifier_rollback=false, java.vm.specification.version=1.0, sun.arch.data.model=32, java.home=C:\Arquivos de programas\Java\jre1.6.0_04, hibernate.connection.url=jdbc:mysql://localhost:3306/exemplojpa, hibernate.dialect=org.hibernate.dialect.MySQLDialect, java.specification.vendor=Sun Microsystems Inc., user.language=pt, awt.toolkit=sun.awt.windows.WToolkit, java.vm.info=mixed mode, sharing, java.version=1.6.0_04, hibernate.transaction.flush_before_completion=false, java.ext.dirs=C:\Arquivos de programas\Java\jre1.6.0_04\lib\ext;C:\WINDOWS\Sun\Java\lib\ext, sun.boot.class.path=C:\Arquivos de programas\Java\jre1.6.0_04\lib\resources.jar;C:\Arquivos de programas\Java\jre1.6.0_04\lib\rt.jar;C:\Arquivos de programas\Java\jre1.6.0_04\lib\sunrsasign.jar;C:\Arquivos de programas\Java\jre1.6.0_04\lib\jsse.jar;C:\Arquivos de programas\Java\jre1.6.0_04\lib\jce.jar;C:\Arquivos de programas\Java\jre1.6.0_04\lib\charsets.jar;C:\Arquivos de programas\Java\jre1.6.0_04\classes, java.vendor=Sun Microsystems Inc., file.separator=\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, sun.cpu.endian=little, sun.io.unicode.encoding=UnicodeLittle, hibernate.query.jpaql_strict_compliance=true, sun.desktop=windows, sun.cpu.isalist=}
4884 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Static SQL for entity: br.com.exemplojpa.modelo.NFItem
4884 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Version select: select id_item from Nota_Fiscal_Item where id_item =?
4884 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Snapshot select: select nfitem_.id_item, nfitem_.fk_id_nota as fk4_2_, nfitem_.qtdeItem as qtdeItem2_, nfitem_.seqItem as seqItem2_ from Nota_Fiscal_Item nfitem_ where nfitem_.id_item=?
4884 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Insert 0: insert into Nota_Fiscal_Item (fk_id_nota, qtdeItem, seqItem, id_item) values (?, ?, ?, ?)
4884 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Update 0: update Nota_Fiscal_Item set fk_id_nota=?, qtdeItem=?, seqItem=? where id_item=?
4884 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Delete 0: delete from Nota_Fiscal_Item where id_item=?
4884 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Identity insert: insert into Nota_Fiscal_Item (fk_id_nota, qtdeItem, seqItem) values (?, ?, ?)
4900 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Static SQL for entity: br.com.exemplojpa.modelo.NotaFiscal
4900 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Version select: select id_nota from Nota_Fiscal where id_nota =?
4900 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Snapshot select: select notafiscal_.id_nota, notafiscal_.nome as nome3_ from Nota_Fiscal notafiscal_ where notafiscal_.id_nota=?
4900 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Insert 0: insert into Nota_Fiscal (nome, id_nota) values (?, ?)
4900 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Update 0: update Nota_Fiscal set nome=? where id_nota=?
4900 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Delete 0: delete from Nota_Fiscal where id_nota=?
4900 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Identity insert: insert into Nota_Fiscal (nome) values (?)
4963 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Static SQL for entity: br.com.exemplojpa.modelo.Usuario1
4963 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Version select: select id from Usuario1 where id =?
4963 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Snapshot select: select usuario1x_.id, usuario1x_.login as login1_, usuario1x_.nome as nome1_, usuario1x_.password as password1_ from Usuario1 usuario1x_ where usuario1x_.id=?
4963 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Insert 0: insert into Usuario1 (login, nome, password, id) values (?, ?, ?, ?)
4963 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Update 0: update Usuario1 set login=?, nome=?, password=? where id=?
4963 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Delete 0: delete from Usuario1 where id=?
4963 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Identity insert: insert into Usuario1 (login, nome, password) values (?, ?, ?)
5009 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Static SQL for entity: br.com.exemplojpa.modelo.Usuario
5009 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Version select: select id from Usuario where id =?
5009 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Snapshot select: select usuario_.id, usuario_.login as login0_, usuario_.nome as nome0_, usuario_.password as password0_ from Usuario usuario_ where usuario_.id=?
5009 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Insert 0: insert into Usuario (login, nome, password, id) values (?, ?, ?, ?)
5009 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Update 0: update Usuario set login=?, nome=?, password=? where id=?
5009 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Delete 0: delete from Usuario where id=?
5009 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Identity insert: insert into Usuario (login, nome, password) values (?, ?, ?)
5025 [main] DEBUG org.hibernate.persister.collection.AbstractCollectionPersister - Static SQL for collection: br.com.exemplojpa.modelo.NotaFiscal.itenss
5025 [main] DEBUG org.hibernate.persister.collection.AbstractCollectionPersister - Row insert: update Nota_Fiscal_Item set fk_id_nota=? where id_item=?
5025 [main] DEBUG org.hibernate.persister.collection.AbstractCollectionPersister - Row delete: update Nota_Fiscal_Item set fk_id_nota=null where fk_id_nota=? and id_item=?
5025 [main] DEBUG org.hibernate.persister.collection.AbstractCollectionPersister - One-shot delete: update Nota_Fiscal_Item set fk_id_nota=null where fk_id_nota=?
5119 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.NFItem: select nfitem0_.id_item as id1_2_1_, nfitem0_.fk_id_nota as fk4_2_1_, nfitem0_.qtdeItem as qtdeItem2_1_, nfitem0_.seqItem as seqItem2_1_, notafiscal1_.id_nota as id1_3_0_, notafiscal1_.nome as nome3_0_ from Nota_Fiscal_Item nfitem0_ left outer join Nota_Fiscal notafiscal1_ on nfitem0_.fk_id_nota=notafiscal1_.id_nota where nfitem0_.id_item=?
5119 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.NFItem: select nfitem0_.id_item as id1_2_1_, nfitem0_.fk_id_nota as fk4_2_1_, nfitem0_.qtdeItem as qtdeItem2_1_, nfitem0_.seqItem as seqItem2_1_, notafiscal1_.id_nota as id1_3_0_, notafiscal1_.nome as nome3_0_ from Nota_Fiscal_Item nfitem0_ left outer join Nota_Fiscal notafiscal1_ on nfitem0_.fk_id_nota=notafiscal1_.id_nota where nfitem0_.id_item=?
5119 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.NFItem: select nfitem0_.id_item as id1_2_0_, nfitem0_.fk_id_nota as fk4_2_0_, nfitem0_.qtdeItem as qtdeItem2_0_, nfitem0_.seqItem as seqItem2_0_ from Nota_Fiscal_Item nfitem0_ where nfitem0_.id_item=? for update
5119 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.NFItem: select nfitem0_.id_item as id1_2_0_, nfitem0_.fk_id_nota as fk4_2_0_, nfitem0_.qtdeItem as qtdeItem2_0_, nfitem0_.seqItem as seqItem2_0_ from Nota_Fiscal_Item nfitem0_ where nfitem0_.id_item=? for update
5166 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.NFItem: select nfitem0_.id_item as id1_2_0_, nfitem0_.fk_id_nota as fk4_2_0_, nfitem0_.qtdeItem as qtdeItem2_0_, nfitem0_.seqItem as seqItem2_0_ from Nota_Fiscal_Item nfitem0_ where nfitem0_.id_item=? for update
5197 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_MERGE on entity br.com.exemplojpa.modelo.NFItem: select nfitem0_.id_item as id1_2_0_, nfitem0_.fk_id_nota as fk4_2_0_, nfitem0_.qtdeItem as qtdeItem2_0_, nfitem0_.seqItem as seqItem2_0_ from Nota_Fiscal_Item nfitem0_ where nfitem0_.id_item=?
5197 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_REFRESH on entity br.com.exemplojpa.modelo.NFItem: select nfitem0_.id_item as id1_2_0_, nfitem0_.fk_id_nota as fk4_2_0_, nfitem0_.qtdeItem as qtdeItem2_0_, nfitem0_.seqItem as seqItem2_0_ from Nota_Fiscal_Item nfitem0_ where nfitem0_.id_item=?
5197 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.NotaFiscal: select notafiscal0_.id_nota as id1_3_1_, notafiscal0_.nome as nome3_1_, itenss1_.fk_id_nota as fk4_3_, itenss1_.id_item as id1_3_, itenss1_.id_item as id1_2_0_, itenss1_.fk_id_nota as fk4_2_0_, itenss1_.qtdeItem as qtdeItem2_0_, itenss1_.seqItem as seqItem2_0_ from Nota_Fiscal notafiscal0_ left outer join Nota_Fiscal_Item itenss1_ on notafiscal0_.id_nota=itenss1_.fk_id_nota where notafiscal0_.id_nota=?
5197 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.NotaFiscal: select notafiscal0_.id_nota as id1_3_1_, notafiscal0_.nome as nome3_1_, itenss1_.fk_id_nota as fk4_3_, itenss1_.id_item as id1_3_, itenss1_.id_item as id1_2_0_, itenss1_.fk_id_nota as fk4_2_0_, itenss1_.qtdeItem as qtdeItem2_0_, itenss1_.seqItem as seqItem2_0_ from Nota_Fiscal notafiscal0_ left outer join Nota_Fiscal_Item itenss1_ on notafiscal0_.id_nota=itenss1_.fk_id_nota where notafiscal0_.id_nota=?
5197 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.NotaFiscal: select notafiscal0_.id_nota as id1_3_0_, notafiscal0_.nome as nome3_0_ from Nota_Fiscal notafiscal0_ where notafiscal0_.id_nota=? for update
5197 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.NotaFiscal: select notafiscal0_.id_nota as id1_3_0_, notafiscal0_.nome as nome3_0_ from Nota_Fiscal notafiscal0_ where notafiscal0_.id_nota=? for update
5197 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.NotaFiscal: select notafiscal0_.id_nota as id1_3_0_, notafiscal0_.nome as nome3_0_ from Nota_Fiscal notafiscal0_ where notafiscal0_.id_nota=? for update
5197 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_MERGE on entity br.com.exemplojpa.modelo.NotaFiscal: select notafiscal0_.id_nota as id1_3_1_, notafiscal0_.nome as nome3_1_, itenss1_.fk_id_nota as fk4_3_, itenss1_.id_item as id1_3_, itenss1_.id_item as id1_2_0_, itenss1_.fk_id_nota as fk4_2_0_, itenss1_.qtdeItem as qtdeItem2_0_, itenss1_.seqItem as seqItem2_0_ from Nota_Fiscal notafiscal0_ left outer join Nota_Fiscal_Item itenss1_ on notafiscal0_.id_nota=itenss1_.fk_id_nota where notafiscal0_.id_nota=?
5213 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_REFRESH on entity br.com.exemplojpa.modelo.NotaFiscal: select notafiscal0_.id_nota as id1_3_1_, notafiscal0_.nome as nome3_1_, itenss1_.fk_id_nota as fk4_3_, itenss1_.id_item as id1_3_, itenss1_.id_item as id1_2_0_, itenss1_.fk_id_nota as fk4_2_0_, itenss1_.qtdeItem as qtdeItem2_0_, itenss1_.seqItem as seqItem2_0_ from Nota_Fiscal notafiscal0_ left outer join Nota_Fiscal_Item itenss1_ on notafiscal0_.id_nota=itenss1_.fk_id_nota where notafiscal0_.id_nota=?
5213 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.Usuario1: select usuario1x0_.id as id1_0_, usuario1x0_.login as login1_0_, usuario1x0_.nome as nome1_0_, usuario1x0_.password as password1_0_ from Usuario1 usuario1x0_ where usuario1x0_.id=?
5213 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.Usuario1: select usuario1x0_.id as id1_0_, usuario1x0_.login as login1_0_, usuario1x0_.nome as nome1_0_, usuario1x0_.password as password1_0_ from Usuario1 usuario1x0_ where usuario1x0_.id=?
5213 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.Usuario1: select usuario1x0_.id as id1_0_, usuario1x0_.login as login1_0_, usuario1x0_.nome as nome1_0_, usuario1x0_.password as password1_0_ from Usuario1 usuario1x0_ where usuario1x0_.id=? for update
5213 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.Usuario1: select usuario1x0_.id as id1_0_, usuario1x0_.login as login1_0_, usuario1x0_.nome as nome1_0_, usuario1x0_.password as password1_0_ from Usuario1 usuario1x0_ where usuario1x0_.id=? for update
5213 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.Usuario1: select usuario1x0_.id as id1_0_, usuario1x0_.login as login1_0_, usuario1x0_.nome as nome1_0_, usuario1x0_.password as password1_0_ from Usuario1 usuario1x0_ where usuario1x0_.id=? for update
5213 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_MERGE on entity br.com.exemplojpa.modelo.Usuario1: select usuario1x0_.id as id1_0_, usuario1x0_.login as login1_0_, usuario1x0_.nome as nome1_0_, usuario1x0_.password as password1_0_ from Usuario1 usuario1x0_ where usuario1x0_.id=?
5213 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_REFRESH on entity br.com.exemplojpa.modelo.Usuario1: select usuario1x0_.id as id1_0_, usuario1x0_.login as login1_0_, usuario1x0_.nome as nome1_0_, usuario1x0_.password as password1_0_ from Usuario1 usuario1x0_ where usuario1x0_.id=?
5213 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.Usuario: select usuario0_.id as id0_0_, usuario0_.login as login0_0_, usuario0_.nome as nome0_0_, usuario0_.password as password0_0_ from Usuario usuario0_ where usuario0_.id=?
5213 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.Usuario: select usuario0_.id as id0_0_, usuario0_.login as login0_0_, usuario0_.nome as nome0_0_, usuario0_.password as password0_0_ from Usuario usuario0_ where usuario0_.id=?
5213 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.Usuario: select usuario0_.id as id0_0_, usuario0_.login as login0_0_, usuario0_.nome as nome0_0_, usuario0_.password as password0_0_ from Usuario usuario0_ where usuario0_.id=? for update
5213 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.Usuario: select usuario0_.id as id0_0_, usuario0_.login as login0_0_, usuario0_.nome as nome0_0_, usuario0_.password as password0_0_ from Usuario usuario0_ where usuario0_.id=? for update
5213 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity br.com.exemplojpa.modelo.Usuario: select usuario0_.id as id0_0_, usuario0_.login as login0_0_, usuario0_.nome as nome0_0_, usuario0_.password as password0_0_ from Usuario usuario0_ where usuario0_.id=? for update
5213 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_MERGE on entity br.com.exemplojpa.modelo.Usuario: select usuario0_.id as id0_0_, usuario0_.login as login0_0_, usuario0_.nome as nome0_0_, usuario0_.password as password0_0_ from Usuario usuario0_ where usuario0_.id=?
5213 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_REFRESH on entity br.com.exemplojpa.modelo.Usuario: select usuario0_.id as id0_0_, usuario0_.login as login0_0_, usuario0_.nome as nome0_0_, usuario0_.password as password0_0_ from Usuario usuario0_ where usuario0_.id=?
5229 [main] DEBUG org.hibernate.loader.collection.OneToManyLoader - Static select for one-to-many br.com.exemplojpa.modelo.NotaFiscal.itenss: select itenss0_.fk_id_nota as fk4_1_, itenss0_.id_item as id1_1_, itenss0_.id_item as id1_2_0_, itenss0_.fk_id_nota as fk4_2_0_, itenss0_.qtdeItem as qtdeItem2_0_, itenss0_.seqItem as seqItem2_0_ from Nota_Fiscal_Item itenss0_ where itenss0_.fk_id_nota=?
5229 [main] DEBUG org.hibernate.impl.SessionFactoryObjectFactory - initializing class SessionFactoryObjectFactory
5244 [main] DEBUG org.hibernate.impl.SessionFactoryObjectFactory - registered: 402881041e176ccb011e176cd0390000 (unnamed)
5244 [main] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
5244 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - instantiated session factory
5244 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - Checking 0 named HQL queries
5244 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - Checking 0 named SQL queries
5432 [main] DEBUG org.hibernate.impl.SessionImpl - opened session at timestamp: [telefone removido]
5432 [main] DEBUG org.hibernate.transaction.JDBCTransaction - begin
5432 [main] DEBUG org.hibernate.jdbc.ConnectionManager - opening JDBC connection
5448 [main] DEBUG org.hibernate.transaction.JDBCTransaction - current autocommit status: true
5448 [main] DEBUG org.hibernate.transaction.JDBCTransaction - disabling autocommit
5526 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener - executing identity-insert immediately
5526 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
5730 [main] DEBUG org.hibernate.SQL -
insert
into
Nota_Fiscal
(nome)
values
(?)
Hibernate:
insert
into
Nota_Fiscal
(nome)
values
(?)
5761 [main] DEBUG org.hibernate.id.IdentifierGeneratorFactory - Natively generated identity: 4
5761 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
5777 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener - executing identity-insert immediately
5777 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
5777 [main] DEBUG org.hibernate.SQL -
insert
into
Nota_Fiscal_Item
(fk_id_nota, qtdeItem, seqItem)
values
(?, ?, ?)
Hibernate:
insert
into
Nota_Fiscal_Item
(fk_id_nota, qtdeItem, seqItem)
values
(?, ?, ?)
5777 [main] DEBUG org.hibernate.id.IdentifierGeneratorFactory - Natively generated identity: 7
5777 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
5777 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener - executing identity-insert immediately
5777 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
5777 [main] DEBUG org.hibernate.SQL -
insert
into
Nota_Fiscal_Item
(fk_id_nota, qtdeItem, seqItem)
values
(?, ?, ?)
Hibernate:
insert
into
Nota_Fiscal_Item
(fk_id_nota, qtdeItem, seqItem)
values
(?, ?, ?)
5792 [main] DEBUG org.hibernate.id.IdentifierGeneratorFactory - Natively generated identity: 8
5792 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
5792 [main] DEBUG org.hibernate.transaction.JDBCTransaction - commit
5792 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - processing flush-time cascades
5792 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - dirty checking collections
5808 [main] DEBUG org.hibernate.engine.Collections - Collection found: [br.com.exemplojpa.modelo.NotaFiscal.itenss#4], was: [<unreferenced>] (initialized)
5823 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 0 insertions, 0 updates, 0 deletions to 3 objects
5823 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 1 (re)creations, 0 updates, 0 removals to 1 collections
5823 [main] DEBUG org.hibernate.pretty.Printer - listing entities:
5823 [main] DEBUG org.hibernate.pretty.Printer - br.com.exemplojpa.modelo.NotaFiscal{id=4, itenss=[br.com.exemplojpa.modelo.NFItem#7, br.com.exemplojpa.modelo.NFItem#8], nome=Nota Fiscal 2 I}
5823 [main] DEBUG org.hibernate.pretty.Printer - br.com.exemplojpa.modelo.NFItem{id=8, seqItem=1, nota=null, qtdeItem=10}
5823 [main] DEBUG org.hibernate.pretty.Printer - br.com.exemplojpa.modelo.NFItem{id=7, seqItem=2, nota=null, qtdeItem=1000}
5870 [main] DEBUG org.hibernate.transaction.JDBCTransaction - re-enabling autocommit
5886 [main] DEBUG org.hibernate.transaction.JDBCTransaction - committed JDBC Connection
5886 [main] DEBUG org.hibernate.jdbc.ConnectionManager - aggressively releasing JDBC connection
5886 [main] DEBUG org.hibernate.jdbc.ConnectionManager - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
Inclusão OK...
Gravação ok....
----
--xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="JPA9">
<description>
Exemplo simples de persistência usando JPA.
</description>
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>br.com.exemplojpa.modelo.Usuario</class>
<class>br.com.exemplojpa.modelo.Usuario1</class>
<class>br.com.exemplojpa.modelo.NFItem</class>
<class>br.com.exemplojpa.modelo.NotaFiscal</class>
<properties>
<property name="hibernate.archive.autodetetion" value="class"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
<property name="hibernate.connection.username" value="root" />
<property name="hibernate.connection.password" value="root" />
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/exemplojpa" />
<property name="hibernate.show_sql" value="true" />
<!-- property name="hibernate.hbm2ddl.auto" value="create" /-->
<property name="hibernate.format_sql" value="true" />
</properties>
</persistence-unit>
</persistence>