Donderdag 16 augustus 2007
Elipse :: java »» Project DAO
:: voorbeeld (sample user , klant : database mysql).
Structuur :
[-]prjdao (project)
| |
| [-]…
Elipse :: java »» Project DAO
:: voorbeeld (sample user , klant : database mysql).
Structuur :
[-]prjdao (project)
| |
| [-]config (map)
| |
klant.hbm.xml
| |
user.hbm.xml
| |
| [-]src (package)
| |
main.java
| |
Klant.java
| |
User.java
| |
KlantDao.java
| |
UserDao.java
| |
HibernateFactory.java
| |
ConstructDao.java
| |
DataAccessError.java
| [+] JRE System Library
| [+] xerces-2.6.2.jar
| [+] ant-antlr-1.6.3.jar
| [+] antlr-2.7.5H3.jar
| [+] asm.jar
| [+] asm-attrs.jar
| [+] cglib-2.1.jar
| [+] commons-collections-2.1.1.jar
| [+] commons-logging-1.0.4.jar
| [+] dom4j-1.6.jar
| [+] ehache-1.1.jar
| [+] hibernate3.jar
| [+] hsqldb.jar
| [+] jta.jar
| [+] log4j-1.2.9.jar
| [+] mysql-connector-java-3.1.6-bin.jar
|
hibernate.cfg.xml
log4j.properties
1.--- begin main.java ------
package src;
import java.util.Date;
public class Main {
public static void main(String[] args) {
Date now = new Date ();
/*
* User toevoegen aan de database
*/
System.out.println("user toegevoegd voor");
UserDao userDao = new UserDao();
User user = new User();
userDao.create(user);
user.setNaam("De Gavere");
user.setWachtwoord("gaverzicht");
user.setAansluiting(now);
userDao.update(user);
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>user
toegevoegd");
userDao.findAll();
/*
* Klant toevoegen aan de database
*/
KlantDao klantDao = new KlantDao();
Klant klant = new Klant();
klantDao.create(klant);
klant.setVoornaam("Kere-gerom");
klant.setAchternaam("Reuzegom");
klant.setStraat("Lange Wapperstraat");
klant.setHuisnr("12");
klant.setPostnr("8640");
klant.setGemeente("Papoptvier");
klantDao.update(klant);
System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>klant
toegevoegd");
klantDao.findAll();
System.out.println("Einde main");
}
}
--- einde Main java ------ top
2.--- begin Klant.java ------
package src;
public class Klant {//implements Serializable {
private Long id;
private String voonaam;
private String achternaam;
private String straat;
private String huisnr;
private String postnr;
private String gemeente;
public Long getId() {return id;}
public void setId(Long id) {this.id = id;}
public String getVoornaam() {return voonaam;}
public void setVoornaam(String voonaam) {this.voonaam = voonaam;}
public String getAchternaam() {return achternaam;}
public void setAchternaam(String achternaam) {this.achternaam = achternaam;}
public String getStraat() {return straat;}
public void setStraat(String straat) {this.straat = straat;}
public String getHuisnr() {return huisnr;}
public void setHuisnr(String huisnr) {this.huisnr = huisnr;}
public String getPostnr() {return postnr;}
public void setPostnr(String postnr) {this.postnr = postnr;}
public String getGemeente() {return gemeente;}
public void setGemeente(String gemeente) {this.gemeente = gemeente;}
}
--- einde Klant.java ------
top
3.--- begin User.java ------
package src;
import java.util.Date;
public class User {
private Long id;
private int werkniveau;
private String naam;
private String wachtwoord;
private Date aansluiting;
public Long getId() {return id;}
public void setId(Long id) {this.id = id;}
public String getNaam() {return naam;}
public void setNaam(String naam) {System.out.println("in klant :naam");this.naam
= naam;}
public String getWachtwoord() {return wachtwoord;}
public void setWachtwoord(String wachtwoord) {this.wachtwoord = wachtwoord;}
public Date getAansluiting() {return aansluiting;}
public void setAansluiting(Date aansluiting) {this.aansluiting = aansluiting;}
public int getwerkniveau() {return werkniveau;}
public void setwerkniveau(int werkniveau) {this.werkniveau = werkniveau;}
}
--- einde User.java ------
top
4.--- begin HibernateFactory.java
------
package src;
import org.hibernate.*;
import org.hibernate.cfg.Configuration;
import org.apache.commons.logging.*;
public class HibernateFactory {
private static SessionFactory sessionFactory;
private static Log log = LogFactory.getLog(HibernateFactory.class);
/*
* Maakt een nieuwe Singleton SessionFactory aan
*/
public static SessionFactory buildSessionFactory() throws
HibernateException {
System.out.println("sessionfact build");
if (sessionFactory != null) {
closeFactory();
}
return configureSessionFactory();
}
/*
* Maakt een nieuwe Singleton SessionFactory aan indien nodig.
*/
public static SessionFactory buildIfNeeded() throws
DataAccessError{
if (sessionFactory != null) {
return sessionFactory;
}
try {
return
configureSessionFactory();
} catch (HibernateException err) {
throw new DataAccessError("build if
needed mislukt >> "+err);
}
}
public static SessionFactory getSessionFactory() {
return sessionFactory;
}
public static Session openSession() throws HibernateException {
buildIfNeeded();
return sessionFactory.openSession();
}
public static void closeFactory() {
if (sessionFactory != null) {
try {
sessionFactory.close();
} catch (HibernateException ignored)
{
log.error("SessionFactory
kon niet afgesloten worden", ignored);
}
}
}
public static void close(Session session) {
if (session != null) {
try {
session.close();
} catch (HibernateException ignored)
{
log.error("Session kon niet
afgesloten worden", ignored);
}
}
}
public static void rollback(Transaction trans) {
try {
if (trans != null) {
trans.rollback();
System.out.println("Terugschroeven");
}
} catch (HibernateException ignored) {
log.error("Transaction-terugschroeven
(rollback) is mislukt", ignored);
}
}
/*
* Configuratie SessionFactory
*/
private static SessionFactory configureSessionFactory() throws
HibernateException {
Configuration configuration = new Configuration();
configuration.configure();
sessionFactory = configuration.buildSessionFactory();
return sessionFactory;
}
}
--- einde HibernateFactory.java ------
top
5.--- begin
ConstructDao.java -----
package src;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.Query;
import java.util.List;
public abstract class ConstructDao {
private Session session;
private Transaction trans;
public ConstructDao() {
System.out.println("maak indien nodig");
HibernateFactory.buildIfNeeded();
}
protected void saveOrUpdate(Object obj) {
try {
System.out.println("saveOrUpdate");
openSessionTrans();
session.saveOrUpdate(obj);
trans.commit();
} catch (HibernateException err) {
handleException(err);
} finally {
HibernateFactory.rollback(trans);
HibernateFactory.close(session);
}
}
protected void delete(Object object) {
try {
openSessionTrans();
session.delete(object);
trans.commit();
} catch (HibernateException err) {
handleException(err);
} finally {
HibernateFactory.close(session);
}
}
protected Object find(Class clazz, Long id) {
Object object = null;
try {
openSessionTrans();
object = session.load(clazz, id);
trans.commit();
} catch (HibernateException err) {
handleException(err);
} finally {
HibernateFactory.close(session);
}
return object;
}
protected List findAll(Class clazz) {
List objects = null;
try {
openSessionTrans();
Query query = session.createQuery("from
" + clazz.getName());
objects = query.list();
trans.commit();
} catch (HibernateException err) {
handleException(err);
} finally {
HibernateFactory.close(session);
}
return objects;
}
protected void handleException(HibernateException err) throws DataAccessError {
HibernateFactory.rollback(trans);
throw new DataAccessError(err);
}
protected void openSessionTrans() throws HibernateException {
System.out.println("openSessionTrans");
session = HibernateFactory.openSession();
trans = session.beginTransaction();
}
}
--- einde ConstructDao.java ------
top
6.--- begin KlantDao.java
------
package src;
import java.util.List;
public class KlantDao extends ConstructDao {
public KlantDao() {
super();
}
/*
* Nieuwe Klant toevoegen aan database.
*/
public void create(Klant klant) throws DataAccessError {
super.saveOrUpdate(klant);
}
/*
* Een Klant verwijderen van de database.
*/
public void delete(Klant klant) throws DataAccessError {
super.delete(klant);
}
/*
* Een Klant vinden met de primary key.
*/
public Klant find(Long id) throws DataAccessError {
System.out.print("klant update");
return (Klant) super.find(Klant.class, id);
}
/*
* Klant toevoegen aan - of wijzigen in de database.
*/
public void update(Klant klant) throws DataAccessError {
System.out.print("klant update");
super.saveOrUpdate(klant);
}
/**
* Zoek alle klanten in de database.
*/
public List findAll() throws DataAccessError{
return super.findAll(Klant.class);
}
}
--- einde klantDao.java ------
top
7.--- begin UserDao.java ------
package src;
import java.util.List;
public class UserDao extends ConstructDao {
public UserDao() {
super();
}
/*
* Een User toevoegen aan - wijzigen in de database.
*/
public void create(User user) throws DataAccessError {
super.saveOrUpdate(user);
}
/*
* Een User verwijderen uit de database.
*/
public void delete(User user) throws DataAccessError {
super.delete(user);
}
/**
* Find an Event by its primary key.
* @param id
* @return
*/
public User find(Long id) throws DataAccessError {
return (User) super.find(User.class, id);
}
/*
* User toevoegen aan - of wijzigen in de database.
*/
public void update(User user) throws DataAccessError {
System.out.println(">>>>> user update");
super.saveOrUpdate(user);
}
/*
* Haal alle users op uit de database.
*/
public List findAll() throws DataAccessError{
return super.findAll(User.class);
}
}
--- einde UserDao.java ------
top
8.--- begin DataAccesError.java ------
package src;
/*
* Exceptions opgeworpen door de Data Access Layer.
*/
public class DataAccessError extends RuntimeException {
public DataAccessError() {
}
public DataAccessError(String message) {
super(message);
}
public DataAccessError(Throwable cause) {
super(cause);
}
public DataAccessError(String message, Throwable cause) {
super(message, cause);
}
}
--- einde DataAccesError.java ------
top
map config
klant.hbm.xml
user.hbm.xml
1.--- begin klant.hbm.xml
------
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping >
<class name="src.Klant" table="klanten">
<id name="id" column="id"
type="long">
<generator class="increment"/>
</id>
<property name="voornaam" type="string"/>
<property name="achternaam" type="string"/>
<property name="straat" type="string"/>
<property name="huisnr" type="string"/>
<property name="postnr" type="string"/>
<property name="gemeente" type="string"/>
</class>
</hibernate-mapping>
--- einde klant.hbm.xml ------
top
2.--- begin user.hbm.xml ------
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping >
<class name="src.User" table="users">
<id name="id" column="id"
type="long">
<generator class="increment"/>
</id>
<property name="naam" type="string"/>
<property name="wachtwoord" type="string"/>
<property name="aansluiting"
type="date"/>
<property name="werkniveau"
type="integer"/>
</class>
</hibernate-mapping>
--- einde user.hbm.xml ------
top
project prjdao
hibernate.cfg.xml
log4j.properties
1.--- begin hibernate.cfg.xml
------
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/mysqltest</property>
<property name="connection.username">db-usernaam</property>
<property name="connection.password">uwpaswoord</property>
<!-- JDBC connection pool (use the
built-in) -->
<property name="connection.pool_size">1</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.HSQLDialect</property>
<!-- Echo all executed SQL to stdout
-->
<property name="show_sql">true</property>
<mapping resource="config/User.hbm.xml"/>
<mapping resource="config/Klant.hbm.xml"/>
</session-factory>
</hibernate-configuration>
--- einde hibernate.cfg.xml ------
top
2.--- begin log4j.properties ------
log4j.rootLogger=DEBUG, A1
log4j.appender.A1=
org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=
org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=
%-4r [%t] %-5p %c %x - %m%n
--- einde log4j.properties ------
top
Tables mysql database "mysqltest"-- phpMyAdmin SQL Dump
-- version 2.6.1-pl3
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generatie Tijd: 17 Aug 2007 om 17:40
-- Server versie: 5.0.24
-- PHP Versie: 5.0.3
--
-- Database: `mysqltest`
--
-- --------------------------------------------------------
--
-- Tabel structuur voor tabel `klanten`
--
CREATE TABLE `klanten` (
`id` bigint(20) NOT NULL auto_increment,
`voornaam` varchar(30) default NULL,
`achternaam` varchar(15) default NULL,
`straat` varchar(30) default NULL,
`huisnr` varchar(10) default NULL,
`postnr` varchar(4) default NULL,
`gemeente` varchar(30) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=36 ;
--
-- Gegevens worden uitgevoerd voor tabel `klanten`
--
INSERT INTO `klanten` VALUES (1, 'Reuzegom', 'Kere-gerom', 'Smallestraat', '12', '8640', 'Tzalbeteren');
INSERT INTO `klanten` VALUES (2, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Tzalbeteren');
INSERT INTO `klanten` VALUES (3, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Tzalbeteren');
INSERT INTO `klanten` VALUES (4, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Tzalbeteren');
INSERT INTO `klanten` VALUES (5, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Tzalbeteren');
INSERT INTO `klanten` VALUES (6, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (7, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (8, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (9, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (10, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (11, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (12, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (13, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (14, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (15, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (16, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (17, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (18, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (19, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (20, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (21, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (22, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (23, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (24, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (25, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (26, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (27, 'Kere-gerom', 'Reuzegom', 'Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (28, 'Kere-gerom', 'Reuzegom', 'Lange Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (29, 'Kere-gerom', 'Reuzegom', 'Lange Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (30, 'Kere-gerom', 'Reuzegom', 'Lange Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (31, 'Kere-gerom', 'Reuzegom', 'Lange Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (32, 'Kere-gerom', 'Reuzegom', 'Lange Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (33, 'Kere-gerom', 'Reuzegom', 'Lange Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (34, 'Kere-gerom', 'Reuzegom', 'Lange Wapperstraat', '12', '8640', 'Papoptvier');
INSERT INTO `klanten` VALUES (35, 'Kere-gerom', 'Reuzegom', 'Lange Wapperstraat', '12', '8640', 'Papoptvier');
-- phpMyAdmin SQL Dump
-- version 2.6.1-pl3
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generatie Tijd: 17 Aug 2007 om 17:41
-- Server versie: 5.0.24
-- PHP Versie: 5.0.3
--
-- Database: `mysqltest`
--
-- --------------------------------------------------------
--
-- Tabel structuur voor tabel `users`
--
CREATE TABLE `users` (
`id` bigint(20) NOT NULL auto_increment,
`naam` varchar(30) default NULL,
`wachtwoord` varchar(10) default NULL,
`aansluiting` date default NULL,
`werkniveau` int(11) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ;
--
-- Gegevens worden uitgevoerd voor tabel `users`
--
INSERT INTO `users` VALUES (1, 'dillems', 'blabla', '2007-07-29', 1);
INSERT INTO `users` VALUES (2, 'De Vlucht', 'Wachtwoord', '2007-08-08', 0);
INSERT INTO `users` VALUES (3, 'De Vlucht', 'Wachtwoord', '2007-08-08', 0);
INSERT INTO `users` VALUES (4, 'De Gavere', 'gaverzicht', '2007-08-08', 0);
INSERT INTO `users` VALUES (5, 'De Gavere', 'gaverzicht', '2007-08-08', 0);
INSERT INTO `users` VALUES (6, 'De Gavere', 'gaverzicht', '2007-08-09', 0);
INSERT INTO `users` VALUES (7, 'De Gavere', 'gaverzicht', '2007-08-09', 0);
INSERT INTO `users` VALUES (8, 'De Gavere', 'gaverzicht', '2007-08-09', 0);
INSERT INTO `users` VALUES (9, 'De Gavere', 'gaverzicht', '2007-08-09', 0);
INSERT INTO `users` VALUES (10, NULL, NULL, NULL, 0);
INSERT INTO `users` VALUES (11, 'De Gavere', 'gaverzicht', '2007-08-17', 0);
INSERT INTO `users` VALUES (12, 'De Gavere', 'gaverzicht', '2007-08-17', 0);
Resultaat prjdao
Woensdag 15 augustus 2007
Resultaat prjdao na vervangen User en KlantDao door dbDao: 0 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.0rc1 0 [main] I…
Resultaat prjdao na vervangen User en KlantDao door dbDao:
0 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.0rc1
0 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
0 [main] INFO org.hibernate.cfg.Environment - using CGLIB reflection optimizer
0 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
0 [main] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
0 [main] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
313 [main] DEBUG org.hibernate.util.DTDEntityResolver - trying to locate http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd in classpath under org/hibernate/
313 [main] DEBUG org.hibernate.util.DTDEntityResolver - found http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd in classpath
360 [main] DEBUG org.hibernate.cfg.Configuration - connection.driver_class=com.mysql.jdbc.Driver
360 [main] DEBUG org.hibernate.cfg.Configuration - connection.url=jdbc:mysql://localhost/mysqltest
375 [main] DEBUG org.hibernate.cfg.Configuration - connection.username=xxxxx
375 [main] DEBUG org.hibernate.cfg.Configuration - connection.password=xxxxxx
375 [main] DEBUG org.hibernate.cfg.Configuration - connection.pool_size=1
375 [main] DEBUG org.hibernate.cfg.Configuration - dialect=org.hibernate.dialect.HSQLDialect
375 [main] DEBUG org.hibernate.cfg.Configuration - show_sql=true
375 [main] DEBUG org.hibernate.cfg.Configuration - null<-org.dom4j.tree.DefaultAttribute@c3c749 [Attribute: name resource value "config/User.hbm.xml"]
375 [main] INFO org.hibernate.cfg.Configuration - Mapping resource: config/User.hbm.xml
375 [main] DEBUG org.hibernate.util.DTDEntityResolver - trying to locate http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd in classpath under org/hibernate/
375 [main] DEBUG org.hibernate.util.DTDEntityResolver - found http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd in classpath
500 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: src.User -> users
500 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: id -> id
516 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: naam -> naam
516 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: wachtwoord -> wachtwoord
516 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: aansluiting -> aansluiting
516 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: werkniveau -> werkniveau
516 [main] DEBUG org.hibernate.cfg.Configuration - null<-org.dom4j.tree.DefaultAttribute@56a499 [Attribute: name resource value "config/Klant.hbm.xml"]
516 [main] INFO org.hibernate.cfg.Configuration - Mapping resource: config/Klant.hbm.xml
516 [main] DEBUG org.hibernate.util.DTDEntityResolver - trying to locate http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd in classpath under org/hibernate/
516 [main] DEBUG org.hibernate.util.DTDEntityResolver - found http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd in classpath
563 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: src.Klant -> klanten
563 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: id -> id
563 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: voornaam -> voornaam
563 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: achternaam -> achternaam
563 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: straat -> straat
563 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: huisnr -> huisnr
563 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: postnr -> postnr
563 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: gemeente -> gemeente
563 [main] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
579 [main] DEBUG org.hibernate.cfg.Configuration - properties:
579 [main] DEBUG org.hibernate.cfg.Configuration - Preparing to build session factory with filters : {}
579 [main] INFO org.hibernate.cfg.Configuration - processing extends queue
579 [main] INFO org.hibernate.cfg.Configuration - processing collection mappings
579 [main] INFO org.hibernate.cfg.Configuration - processing association property references
579 [main] INFO org.hibernate.cfg.Configuration - processing foreign key constraints
672 [main] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.HSQLDialect
672 [main] DEBUG org.hibernate.exception.SQLExceptionConverterFactory - Using dialect defined converter
688 [main] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
688 [main] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
688 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
688 [main] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
688 [main] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
688 [main] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
688 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
688 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 1
688 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
704 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/mysqltest
704 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=user, password=passwoord}
704 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - total checked-out connections: 0
704 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - opening new JDBC connection
891 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - created connection to: jdbc:mysql://localhost/mysqltest, Isolation Level: 4
891 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - returning connection to pool, pool size: 1
891 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
891 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
891 [main] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
891 [main] DEBUG org.hibernate.cfg.SettingsFactory - Wrap result sets: disabled
891 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled
891 [main] INFO org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
891 [main] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
907 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
907 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
907 [main] INFO org.hibernate.cfg.SettingsFactory - Cache provider: org.hibernate.cache.EhCacheProvider
907 [main] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
907 [main] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
907 [main] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: enabled
907 [main] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
907 [main] INFO org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
907 [main] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
907 [main] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
907 [main] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
1063 [main] INFO org.hibernate.impl.SessionFactoryImpl - building session factory
1063 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - Session factory constructed with filter configurations : {}
1063 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - instantiating session factory with properties:
1063 [main] DEBUG net.sf.ehcache.CacheManager - Creating new CacheManager with default config
1063 [main] DEBUG net.sf.ehcache.CacheManager - Configuring ehcache from classpath.
1063 [main] WARN net.sf.ehcache.config.Configurator - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/J:/eclipse/jars_plugins/jars/ibernate3-extra/ehcache-1.1.jar!/ehcache-failsafe.xml
1079 [main] DEBUG net.sf.ehcache.config.Configuration$DiskStore - Disk Store Path: C:DOCUME~1EigenaarLOCALS~1Temp
in klant :naam
1360 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Static SQL for entity: src.User
1360 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Version select: select id from users where id =?
1360 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Snapshot select: select user_.id, user_.naam as naam0_, user_.wachtwoord as wachtwoord0_, user_.aansluiting as aansluit4_0_, user_.werkniveau as werkniveau0_ from users user_ where user_.id=?
1360 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Insert 0: insert into users (naam, wachtwoord, aansluiting, werkniveau, id) values (?, ?, ?, ?, ?)
1360 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Update 0: update users set naam=?, wachtwoord=?, aansluiting=?, werkniveau=? where id=?
1360 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Delete 0: delete from users where id=?
1454 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Static SQL for entity: src.Klant
1454 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Version select: select id from klanten where id =?
1454 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Snapshot select: select klant_.id, klant_.voornaam as voornaam1_, klant_.achternaam as achternaam1_, klant_.straat as straat1_, klant_.huisnr as huisnr1_, klant_.postnr as postnr1_, klant_.gemeente as gemeente1_ from klanten klant_ where klant_.id=?
1454 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Insert 0: insert into klanten (voornaam, achternaam, straat, huisnr, postnr, gemeente, id) values (?, ?, ?, ?, ?, ?, ?)
1454 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Update 0: update klanten set voornaam=?, achternaam=?, straat=?, huisnr=?, postnr=?, gemeente=? where id=?
1454 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Delete 0: delete from klanten where id=?
1485 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity src.User: select user0_.id as id0_, user0_.naam as naam0_0_, user0_.wachtwoord as wachtwoord0_0_, user0_.aansluiting as aansluit4_0_0_, user0_.werkniveau as werkniveau0_0_ from users user0_ where user0_.id=?
1485 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity src.User: select user0_.id as id0_, user0_.naam as naam0_0_, user0_.wachtwoord as wachtwoord0_0_, user0_.aansluiting as aansluit4_0_0_, user0_.werkniveau as werkniveau0_0_ from users user0_ where user0_.id=?
1485 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity src.User: select user0_.id as id0_, user0_.naam as naam0_0_, user0_.wachtwoord as wachtwoord0_0_, user0_.aansluiting as aansluit4_0_0_, user0_.werkniveau as werkniveau0_0_ from users user0_ where user0_.id=?
1485 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity src.User: select user0_.id as id0_, user0_.naam as naam0_0_, user0_.wachtwoord as wachtwoord0_0_, user0_.aansluiting as aansluit4_0_0_, user0_.werkniveau as werkniveau0_0_ from users user0_ where user0_.id=?
1485 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity src.Klant: select klant0_.id as id0_, klant0_.voornaam as voornaam1_0_, klant0_.achternaam as achternaam1_0_, klant0_.straat as straat1_0_, klant0_.huisnr as huisnr1_0_, klant0_.postnr as postnr1_0_, klant0_.gemeente as gemeente1_0_ from klanten klant0_ where klant0_.id=?
1485 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity src.Klant: select klant0_.id as id0_, klant0_.voornaam as voornaam1_0_, klant0_.achternaam as achternaam1_0_, klant0_.straat as straat1_0_, klant0_.huisnr as huisnr1_0_, klant0_.postnr as postnr1_0_, klant0_.gemeente as gemeente1_0_ from klanten klant0_ where klant0_.id=?
1485 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity src.Klant: select klant0_.id as id0_, klant0_.voornaam as voornaam1_0_, klant0_.achternaam as achternaam1_0_, klant0_.straat as straat1_0_, klant0_.huisnr as huisnr1_0_, klant0_.postnr as postnr1_0_, klant0_.gemeente as gemeente1_0_ from klanten klant0_ where klant0_.id=?
1485 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity src.Klant: select klant0_.id as id0_, klant0_.voornaam as voornaam1_0_, klant0_.achternaam as achternaam1_0_, klant0_.straat as straat1_0_, klant0_.huisnr as huisnr1_0_, klant0_.postnr as postnr1_0_, klant0_.gemeente as gemeente1_0_ from klanten klant0_ where klant0_.id=?
1485 [main] DEBUG org.hibernate.impl.SessionFactoryObjectFactory - initializing class SessionFactoryObjectFactory
1500 [main] DEBUG org.hibernate.impl.SessionFactoryObjectFactory - registered: 402881e6147cdcb601147cdcb85d0000 (unnamed)
1500 [main] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
1500 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - instantiated session factory
1500 [main] INFO org.hibernate.impl.SessionFactoryImpl - Checking 0 named queries
>>>>> user update
saveOrUpdate
openSessionTrans
sessionfactorg.hibernate.impl.SessionFactoryImpl@fbb7cb
1532 [main] DEBUG org.hibernate.impl.SessionImpl - opened session
1532 [main] DEBUG org.hibernate.transaction.JDBCTransaction - begin
1532 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - opening JDBC connection
1532 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - total checked-out connections: 0
1532 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - using pooled JDBC connection, pool size: 0
1532 [main] DEBUG org.hibernate.transaction.JDBCTransaction - current autocommit status: false
1532 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener - transient instance of: src.User
1532 [main] DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener - saving transient instance
1532 [main] DEBUG org.hibernate.id.IncrementGenerator - fetching initial value: select max(id) from users
1547 [main] DEBUG org.hibernate.id.IncrementGenerator - first free id: 2
1547 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener - generated identifier: 2, using strategy: org.hibernate.id.IncrementGenerator
1547 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener - saving [src.User#2]
1563 [main] DEBUG org.hibernate.transaction.JDBCTransaction - commit
1563 [main] DEBUG org.hibernate.impl.SessionImpl - automatically flushing session
1563 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - flushing session
1563 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - processing flush-time cascades
1563 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - dirty checking collections
1563 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushing entities and processing referenced collections
1563 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Processing unreferenced collections
1563 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Scheduling collection removes/(re)creates/updates
1563 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 1 insertions, 0 updates, 0 deletions to 1 objects
1563 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
1563 [main] DEBUG org.hibernate.pretty.Printer - listing entities:
1579 [main] DEBUG org.hibernate.pretty.Printer - src.User{aansluiting=19 augustus 2007, naam=De Koster, wachtwoord=kost, id=2, werkniveau=0}
1579 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - executing flush
1579 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Inserting entity: [src.User#2]
1579 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
1579 [main] DEBUG org.hibernate.SQL - insert into users (naam, wachtwoord, aansluiting, werkniveau, id) values (?, ?, ?, ?, ?)
Hibernate: insert into users (naam, wachtwoord, aansluiting, werkniveau, id) values (?, ?, ?, ?, ?)
1579 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - preparing statement
1579 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Dehydrating entity: [src.User#2]
1579 [main] DEBUG org.hibernate.type.StringType - binding 'De Koster' to parameter: 1
1579 [main] DEBUG org.hibernate.type.StringType - binding 'kost' to parameter: 2
1579 [main] DEBUG org.hibernate.type.DateType - binding '19 augustus 2007' to parameter: 3
1579 [main] DEBUG org.hibernate.type.IntegerType - binding '0' to parameter: 4
1579 [main] DEBUG org.hibernate.type.LongType - binding '2' to parameter: 5
1579 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - Adding to batch
1579 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - Executing batch size: 1
1579 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
1579 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - closing statement
1579 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - post flush
1579 [main] DEBUG org.hibernate.jdbc.JDBCContext - before transaction completion
1579 [main] DEBUG org.hibernate.impl.SessionImpl - before transaction completion
1610 [main] DEBUG org.hibernate.transaction.JDBCTransaction - committed JDBC Connection
1610 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction completion
1610 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction completion
1610 [main] DEBUG org.hibernate.transaction.JDBCTransaction - rollback
1610 [main] DEBUG org.hibernate.jdbc.JDBCContext - before transaction completion
1610 [main] DEBUG org.hibernate.impl.SessionImpl - before transaction completion
1610 [main] DEBUG org.hibernate.transaction.JDBCTransaction - rolled back JDBC Connection
1610 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction completion
1610 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction completion
Terugschroeven
1610 [main] DEBUG org.hibernate.impl.SessionImpl - closing session
1610 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - closing JDBC connection (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)
1610 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - returning connection to pool, pool size: 1
1610 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction completion
1610 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction completion
>>>>>>>>>>>>>>>>>>>>>>>>>>user toegevoegd
openSessionTrans
sessionfactorg.hibernate.impl.SessionFactoryImpl@fbb7cb
1610 [main] DEBUG org.hibernate.impl.SessionImpl - opened session
1610 [main] DEBUG org.hibernate.transaction.JDBCTransaction - begin
1610 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - opening JDBC connection
1610 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - total checked-out connections: 0
1610 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - using pooled JDBC connection, pool size: 0
1610 [main] DEBUG org.hibernate.transaction.JDBCTransaction - current autocommit status: false
1610 [main] DEBUG org.hibernate.impl.SessionImpl - find: from src.User
1610 [main] DEBUG org.hibernate.engine.QueryParameters - named parameters: {}
1625 [Finalizer] DEBUG org.hibernate.jdbc.JDBCContext - running Session.finalize()
1688 [main] DEBUG org.hibernate.hql.ast.QueryTranslatorImpl - parse() - HQL: from src.User
1704 [main] DEBUG org.hibernate.hql.AST - --- HQL AST ---
-[QUERY] CommonAST: 'query'
-[SELECT_FROM] CommonAST: 'SELECT_FROM'
-[FROM] CommonAST: 'from'
-[DOT] CommonAST: '.'
+-[IDENT] CommonAST: 'src'
-[IDENT] CommonAST: 'User'
1704 [main] DEBUG hql.parser - throwQueryException() : no errors
1735 [main] DEBUG org.hibernate.hql.antlr.HqlSqlBaseWalker - query() << begin, level = 1
1766 [main] DEBUG org.hibernate.hql.ast.FromElement - src.User (no alias) -> user0_
1766 [main] DEBUG org.hibernate.hql.antlr.HqlSqlBaseWalker - query() : finishing up...
1766 [main] DEBUG org.hibernate.hql.ast.HqlSqlWalker - Derived SELECT clause created.
1782 [main] DEBUG org.hibernate.hql.ast.JoinProcessor - Using FROM fragment [users user0_]
1782 [main] DEBUG org.hibernate.hql.antlr.HqlSqlBaseWalker - query() >> end, level = 1
1782 [main] DEBUG org.hibernate.hql.AST - --- SQL AST ---
-[SELECT] QueryNode: 'SELECT' querySpaces (users)
+-[SELECT_CLAUSE] SelectClause: '{derived select clause}'
| +-[SELECT_EXPR] SelectExpressionImpl: 'user0_.id as id' {FromElement{explicit,not a collection join,classAlias=null,role=null,tableName=users,tableAlias=user0_,colums={,className=src.User}}}
| -[SQL_TOKEN] SqlFragment: 'user0_.naam as naam0_, user0_.wachtwoord as wachtwoord0_, user0_.aansluiting as aansluit4_0_, user0_.werkniveau as werkniveau0_'
-[FROM] FromClause: 'from' FromClause{from}
-[FROM_FRAGMENT] FromElement: 'users user0_' FromElement{explicit,not a collection join,classAlias=null,role=null,tableName=users,tableAlias=user0_,colums={,className=src.User}}
1782 [main] DEBUG hql.parser - throwQueryException() : no errors
1797 [main] DEBUG org.hibernate.hql.ast.QueryTranslatorImpl - HQL: from src.User
1797 [main] DEBUG org.hibernate.hql.ast.QueryTranslatorImpl - SQL: select user0_.id as id, user0_.naam as naam0_, user0_.wachtwoord as wachtwoord0_, user0_.aansluiting as aansluit4_0_, user0_.werkniveau as werkniveau0_ from users user0_
1797 [main] DEBUG hql.parser - throwQueryException() : no errors
1797 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
1797 [main] DEBUG org.hibernate.SQL - select user0_.id as id, user0_.naam as naam0_, user0_.wachtwoord as wachtwoord0_, user0_.aansluiting as aansluit4_0_, user0_.werkniveau as werkniveau0_ from users user0_
Hibernate: select user0_.id as id, user0_.naam as naam0_, user0_.wachtwoord as wachtwoord0_, user0_.aansluiting as aansluit4_0_, user0_.werkniveau as werkniveau0_ from users user0_
1797 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - preparing statement
1797 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open ResultSet (open ResultSets: 0, globally: 0)
1797 [main] DEBUG org.hibernate.loader.Loader - processing result set
1797 [main] DEBUG org.hibernate.loader.Loader - result set row: 0
1797 [main] DEBUG org.hibernate.type.LongType - returning '1' as column: id
1797 [main] DEBUG org.hibernate.loader.Loader - result row: EntityKey[src.User#1]
1797 [main] DEBUG org.hibernate.loader.Loader - Initializing object from ResultSet: [src.User#1]
1797 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Hydrating entity: [src.User#1]
1797 [main] DEBUG org.hibernate.type.StringType - returning 'De Koster' as column: naam0_
1797 [main] DEBUG org.hibernate.type.StringType - returning 'kost' as column: wachtwoord0_
1813 [main] DEBUG org.hibernate.type.DateType - returning '19 augustus 2007' as column: aansluit4_0_
1813 [main] DEBUG org.hibernate.type.IntegerType - returning '0' as column: werkniveau0_
1813 [main] DEBUG org.hibernate.loader.Loader - result set row: 1
1813 [main] DEBUG org.hibernate.type.LongType - returning '2' as column: id
1813 [main] DEBUG org.hibernate.loader.Loader - result row: EntityKey[src.User#2]
1813 [main] DEBUG org.hibernate.loader.Loader - Initializing object from ResultSet: [src.User#2]
1813 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Hydrating entity: [src.User#2]
1813 [main] DEBUG org.hibernate.type.StringType - returning 'De Koster' as column: naam0_
1813 [main] DEBUG org.hibernate.type.StringType - returning 'kost' as column: wachtwoord0_
1813 [main] DEBUG org.hibernate.type.DateType - returning '19 augustus 2007' as column: aansluit4_0_
1813 [main] DEBUG org.hibernate.type.IntegerType - returning '0' as column: werkniveau0_
1813 [main] DEBUG org.hibernate.loader.Loader - done processing result set (2 rows)
1813 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close ResultSet (open ResultSets: 1, globally: 1)
1813 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
1813 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - closing statement
1813 [main] DEBUG org.hibernate.loader.Loader - total objects hydrated: 2
1813 [main] DEBUG org.hibernate.engine.TwoPhaseLoad - resolving associations for [src.User#1]
in klant :naam
1813 [main] DEBUG org.hibernate.engine.TwoPhaseLoad - done materializing entity [src.User#1]
1813 [main] DEBUG org.hibernate.engine.TwoPhaseLoad - resolving associations for [src.User#2]
in klant :naam
1813 [main] DEBUG org.hibernate.engine.TwoPhaseLoad - done materializing entity [src.User#2]
1813 [main] DEBUG org.hibernate.engine.PersistenceContext - initializing non-lazy collections
1813 [main] DEBUG org.hibernate.transaction.JDBCTransaction - commit
1813 [main] DEBUG org.hibernate.impl.SessionImpl - automatically flushing session
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - flushing session
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - processing flush-time cascades
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - dirty checking collections
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushing entities and processing referenced collections
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Processing unreferenced collections
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Scheduling collection removes/(re)creates/updates
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 0 insertions, 0 updates, 0 deletions to 2 objects
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
1813 [main] DEBUG org.hibernate.pretty.Printer - listing entities:
1813 [main] DEBUG org.hibernate.pretty.Printer - src.User{aansluiting=19 augustus 2007, naam=De Koster, wachtwoord=kost, id=2, werkniveau=0}
1813 [main] DEBUG org.hibernate.pretty.Printer - src.User{aansluiting=19 augustus 2007, naam=De Koster, wachtwoord=kost, id=1, werkniveau=0}
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - executing flush
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - post flush
1813 [main] DEBUG org.hibernate.jdbc.JDBCContext - before transaction completion
1813 [main] DEBUG org.hibernate.impl.SessionImpl - before transaction completion
1813 [main] DEBUG org.hibernate.transaction.JDBCTransaction - committed JDBC Connection
1813 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction completion
1813 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction completion
1813 [main] DEBUG org.hibernate.impl.SessionImpl - closing session
1813 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - closing JDBC connection (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)
1813 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - returning connection to pool, pool size: 1
1813 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction completion
1813 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction completion
maak indien nodig
sessionfactorg.hibernate.impl.SessionFactoryImpl@fbb7cb
>>>>> user update
saveOrUpdate
openSessionTrans
sessionfactorg.hibernate.impl.SessionFactoryImpl@fbb7cb
1813 [main] DEBUG org.hibernate.impl.SessionImpl - opened session
1813 [main] DEBUG org.hibernate.transaction.JDBCTransaction - begin
1813 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - opening JDBC connection
1813 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - total checked-out connections: 0
1813 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - using pooled JDBC connection, pool size: 0
1813 [main] DEBUG org.hibernate.transaction.JDBCTransaction - current autocommit status: false
1813 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener - transient instance of: src.Klant
1813 [main] DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener - saving transient instance
1813 [main] DEBUG org.hibernate.id.IncrementGenerator - fetching initial value: select max(id) from klanten
1813 [main] DEBUG org.hibernate.id.IncrementGenerator - first free id: 2
1813 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener - generated identifier: 2, using strategy: org.hibernate.id.IncrementGenerator
1813 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener - saving [src.Klant#2]
1813 [main] DEBUG org.hibernate.transaction.JDBCTransaction - commit
1813 [main] DEBUG org.hibernate.impl.SessionImpl - automatically flushing session
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - flushing session
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - processing flush-time cascades
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - dirty checking collections
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushing entities and processing referenced collections
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Processing unreferenced collections
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Scheduling collection removes/(re)creates/updates
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 1 insertions, 0 updates, 0 deletions to 1 objects
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
1813 [main] DEBUG org.hibernate.pretty.Printer - listing entities:
1813 [main] DEBUG org.hibernate.pretty.Printer - src.Klant{postnr=4578, straat=Klantenstraat, voornaam=Andre, gemeente=Winkelen, huisnr=15, achternaam=De Client, id=2}
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - executing flush
1813 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Inserting entity: [src.Klant#2]
1813 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
1813 [main] DEBUG org.hibernate.SQL - insert into klanten (voornaam, achternaam, straat, huisnr, postnr, gemeente, id) values (?, ?, ?, ?, ?, ?, ?)
Hibernate: insert into klanten (voornaam, achternaam, straat, huisnr, postnr, gemeente, id) values (?, ?, ?, ?, ?, ?, ?)
1813 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - preparing statement
1813 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Dehydrating entity: [src.Klant#2]
1813 [main] DEBUG org.hibernate.type.StringType - binding 'Andre' to parameter: 1
1813 [main] DEBUG org.hibernate.type.StringType - binding 'De Client' to parameter: 2
1813 [main] DEBUG org.hibernate.type.StringType - binding 'Klantenstraat' to parameter: 3
1813 [main] DEBUG org.hibernate.type.StringType - binding '15' to parameter: 4
1813 [main] DEBUG org.hibernate.type.StringType - binding '4578' to parameter: 5
1813 [main] DEBUG org.hibernate.type.StringType - binding 'Winkelen' to parameter: 6
1813 [main] DEBUG org.hibernate.type.LongType - binding '2' to parameter: 7
1813 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - Adding to batch
1813 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - Executing batch size: 1
1813 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
1813 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - closing statement
1813 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - post flush
1813 [main] DEBUG org.hibernate.jdbc.JDBCContext - before transaction completion
1813 [main] DEBUG org.hibernate.impl.SessionImpl - before transaction completion
1844 [main] DEBUG org.hibernate.transaction.JDBCTransaction - committed JDBC Connection
1844 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction completion
1844 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction completion
1844 [main] DEBUG org.hibernate.transaction.JDBCTransaction - rollback
1844 [main] DEBUG org.hibernate.jdbc.JDBCContext - before transaction completion
1844 [main] DEBUG org.hibernate.impl.SessionImpl - before transaction completion
1844 [main] DEBUG org.hibernate.transaction.JDBCTransaction - rolled back JDBC Connection
1844 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction completion
1844 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction completion
Terugschroeven
1844 [main] DEBUG org.hibernate.impl.SessionImpl - closing session
1844 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - closing JDBC connection (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)
1844 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - returning connection to pool, pool size: 1
1844 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction completion
1844 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction completion
>>>>>>>>>>>>>>>>>>>>>>>>>>klant toegevoegd
openSessionTrans
sessionfactorg.hibernate.impl.SessionFactoryImpl@fbb7cb
1844 [main] DEBUG org.hibernate.impl.SessionImpl - opened session
1844 [main] DEBUG org.hibernate.transaction.JDBCTransaction - begin
1844 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - opening JDBC connection
1844 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - total checked-out connections: 0
1844 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - using pooled JDBC connection, pool size: 0
1844 [main] DEBUG org.hibernate.transaction.JDBCTransaction - current autocommit status: false
1844 [main] DEBUG org.hibernate.impl.SessionImpl - find: from src.Klant
1844 [main] DEBUG org.hibernate.engine.QueryParameters - named parameters: {}
1844 [main] DEBUG org.hibernate.hql.ast.QueryTranslatorImpl - parse() - HQL: from src.Klant
1860 [main] DEBUG org.hibernate.hql.AST - --- HQL AST ---
-[QUERY] CommonAST: 'query'
-[SELECT_FROM] CommonAST: 'SELECT_FROM'
-[FROM] CommonAST: 'from'
-[DOT] CommonAST: '.'
+-[IDENT] CommonAST: 'src'
-[IDENT] CommonAST: 'Klant'
1860 [main] DEBUG hql.parser - throwQueryException() : no errors
1860 [main] DEBUG org.hibernate.hql.antlr.HqlSqlBaseWalker - query() << begin, level = 1
1860 [main] DEBUG org.hibernate.hql.ast.FromElement - src.Klant (no alias) -> klant0_
1860 [main] DEBUG org.hibernate.hql.antlr.HqlSqlBaseWalker - query() : finishing up...
1860 [main] DEBUG org.hibernate.hql.ast.HqlSqlWalker - Derived SELECT clause created.
1860 [main] DEBUG org.hibernate.hql.ast.JoinProcessor - Using FROM fragment [klanten klant0_]
1860 [main] DEBUG org.hibernate.hql.antlr.HqlSqlBaseWalker - query() >> end, level = 1
1860 [main] DEBUG org.hibernate.hql.AST - --- SQL AST ---
-[SELECT] QueryNode: 'SELECT' querySpaces (klanten)
+-[SELECT_CLAUSE] SelectClause: '{derived select clause}'
| +-[SELECT_EXPR] SelectExpressionImpl: 'klant0_.id as id' {FromElement{explicit,not a collection join,classAlias=null,role=null,tableName=klanten,tableAlias=klant0_,colums={,className=src.Klant}}}
| -[SQL_TOKEN] SqlFragment: 'klant0_.voornaam as voornaam1_, klant0_.achternaam as achternaam1_, klant0_.straat as straat1_, klant0_.huisnr as huisnr1_, klant0_.postnr as postnr1_, klant0_.gemeente as gemeente1_'
-[FROM] FromClause: 'from' FromClause{from}
-[FROM_FRAGMENT] FromElement: 'klanten klant0_' FromElement{explicit,not a collection join,classAlias=null,role=null,tableName=klanten,tableAlias=klant0_,colums={,className=src.Klant}}
1860 [main] DEBUG hql.parser - throwQueryException() : no errors
1860 [main] DEBUG org.hibernate.hql.ast.QueryTranslatorImpl - HQL: from src.Klant
1860 [main] DEBUG org.hibernate.hql.ast.QueryTranslatorImpl - SQL: select klant0_.id as id, klant0_.voornaam as voornaam1_, klant0_.achternaam as achternaam1_, klant0_.straat as straat1_, klant0_.huisnr as huisnr1_, klant0_.postnr as postnr1_, klant0_.gemeente as gemeente1_ from klanten klant0_
1860 [main] DEBUG hql.parser - throwQueryException() : no errors
1860 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
1860 [main] DEBUG org.hibernate.SQL - select klant0_.id as id, klant0_.voornaam as voornaam1_, klant0_.achternaam as achternaam1_, klant0_.straat as straat1_, klant0_.huisnr as huisnr1_, klant0_.postnr as postnr1_, klant0_.gemeente as gemeente1_ from klanten klant0_
Hibernate: select klant0_.id as id, klant0_.voornaam as voornaam1_, klant0_.achternaam as achternaam1_, klant0_.straat as straat1_, klant0_.huisnr as huisnr1_, klant0_.postnr as postnr1_, klant0_.gemeente as gemeente1_ from klanten klant0_
1860 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - preparing statement
1860 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open ResultSet (open ResultSets: 0, globally: 0)
1860 [main] DEBUG org.hibernate.loader.Loader - processing result set
1860 [main] DEBUG org.hibernate.loader.Loader - result set row: 0
1860 [main] DEBUG org.hibernate.type.LongType - returning '1' as column: id
1860 [main] DEBUG org.hibernate.loader.Loader - result row: EntityKey[src.Klant#1]
1860 [main] DEBUG org.hibernate.loader.Loader - Initializing object from ResultSet: [src.Klant#1]
1860 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Hydrating entity: [src.Klant#1]
1860 [main] DEBUG org.hibernate.type.StringType - returning 'Andre' as column: voornaam1_
1860 [main] DEBUG org.hibernate.type.StringType - returning 'De Client' as column: achternaam1_
1860 [main] DEBUG org.hibernate.type.StringType - returning 'Klantenstraat' as column: straat1_
1860 [main] DEBUG org.hibernate.type.StringType - returning '15' as column: huisnr1_
1860 [main] DEBUG org.hibernate.type.StringType - returning '4578' as column: postnr1_
1860 [main] DEBUG org.hibernate.type.StringType - returning 'Winkelen' as column: gemeente1_
1860 [main] DEBUG org.hibernate.loader.Loader - result set row: 1
1860 [main] DEBUG org.hibernate.type.LongType - returning '2' as column: id
1860 [main] DEBUG org.hibernate.loader.Loader - result row: EntityKey[src.Klant#2]
1860 [main] DEBUG org.hibernate.loader.Loader - Initializing object from ResultSet: [src.Klant#2]
1860 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Hydrating entity: [src.Klant#2]
1860 [main] DEBUG org.hibernate.type.StringType - returning 'Andre' as column: voornaam1_
1860 [main] DEBUG org.hibernate.type.StringType - returning 'De Client' as column: achternaam1_
1860 [main] DEBUG org.hibernate.type.StringType - returning 'Klantenstraat' as column: straat1_
1860 [main] DEBUG org.hibernate.type.StringType - returning '15' as column: huisnr1_
1860 [main] DEBUG org.hibernate.type.StringType - returning '4578' as column: postnr1_
1860 [main] DEBUG org.hibernate.type.StringType - returning 'Winkelen' as column: gemeente1_
1860 [main] DEBUG org.hibernate.loader.Loader - done processing result set (2 rows)
1860 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close ResultSet (open ResultSets: 1, globally: 1)
1860 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
1860 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - closing statement
1860 [main] DEBUG org.hibernate.loader.Loader - total objects hydrated: 2
1860 [main] DEBUG org.hibernate.engine.TwoPhaseLoad - resolving associations for [src.Klant#1]
1860 [main] DEBUG org.hibernate.engine.TwoPhaseLoad - done materializing entity [src.Klant#1]
1860 [main] DEBUG org.hibernate.engine.TwoPhaseLoad - resolving associations for [src.Klant#2]
1860 [main] DEBUG org.hibernate.engine.TwoPhaseLoad - done materializing entity [src.Klant#2]
1860 [main] DEBUG org.hibernate.engine.PersistenceContext - initializing non-lazy collections
1860 [main] DEBUG org.hibernate.transaction.JDBCTransaction - commit
1860 [main] DEBUG org.hibernate.impl.SessionImpl - automatically flushing session
1860 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - flushing session
1860 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - processing flush-time cascades
1860 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - dirty checking collections
1860 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushing entities and processing referenced collections
1860 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Processing unreferenced collections
1860 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Scheduling collection removes/(re)creates/updates
1860 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 0 insertions, 0 updates, 0 deletions to 2 objects
1860 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
1860 [main] DEBUG org.hibernate.pretty.Printer - listing entities:
1860 [main] DEBUG org.hibernate.pretty.Printer - src.Klant{postnr=4578, straat=Klantenstraat, voornaam=Andre, gemeente=Winkelen, huisnr=15, achternaam=De Client, id=2}
1860 [main] DEBUG org.hibernate.pretty.Printer - src.Klant{postnr=4578, straat=Klantenstraat, voornaam=Andre, gemeente=Winkelen, huisnr=15, achternaam=De Client, id=1}
1860 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - executing flush
1860 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - post flush
1860 [main] DEBUG org.hibernate.jdbc.JDBCContext - before transaction completion
1860 [main] DEBUG org.hibernate.impl.SessionImpl - before transaction completion
1860 [main] DEBUG org.hibernate.transaction.JDBCTransaction - committed JDBC Connection
1860 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction completion
1860 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction completion
1860 [main] DEBUG org.hibernate.impl.SessionImpl - closing session
1860 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - closing JDBC connection (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)
1860 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - returning connection to pool, pool size: 1
1875 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction completion
1875 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction completion
Einde main