Thank you. The SQL is now shown in the debug.
How come the debug is not going to the file like I configure it?
log4j.properties
Code:
### direct log messages to stdout ###
#log4j.appender.stdout=org.apache.log4j.ConsoleAppender
#log4j.appender.stdout.Target=System.out
#log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
#log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### direct messages to file hibernate.log ###
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File=C:\\Program Files\\WebSphere\\AppServer\\installedApps\\lithium\\BoardroomFinder.ear\\boardroom.war\\boardroom.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### set log levels - for more verbose logging change 'info' to 'debug' ###
log4j.rootLogger=warn, file
log4j.logger.org.hibernate=info
#log4j.logger.org.hibernate=debug
### log HQL query parser activity
#log4j.logger.org.hibernate.hql.ast.AST=debug
### log just the SQL
log4j.logger.org.hibernate.SQL=debug
### log JDBC bind parameters ###
log4j.logger.org.hibernate.type=info
#log4j.logger.org.hibernate.type=debug
### log schema export/update ###
log4j.logger.org.hibernate.tool.hbm2ddl=debug
### log HQL parse trees
#log4j.logger.org.hibernate.hql=debug
### log cache activity ###
#log4j.logger.org.hibernate.cache=debug
### log transaction activity
#log4j.logger.org.hibernate.transaction=debug
### log JDBC resource acquisition
#log4j.logger.org.hibernate.jdbc=debug
### enable the following line if you want to track down connection ###
### leakages when using DriverManagerConnectionProvider ###
#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace
This would save me from digging through Websphere logs. However, this is the SQL error
Code:
[8/19/05 8:55:49:084 EDT] 6789eeba SystemOut O Hibernate: select bfboardroo0_.ID as ID0_, bfboardroo0_.DEPARTMENTID as DEPARTME2_0_0_, bfboardroo0_.PENDINGSTATUS as PENDINGS3_0_0_, bfboardroo0_.TITLE as TITLE0_0_, bfboardroo0_.ADDRESS as ADDRESS0_0_, bfboardroo0_.PROVINCE as PROVINCE0_0_, bfboardroo0_.CITY as CITY0_0_, bfboardroo0_.MINCAPACITY as MINCAPAC8_0_0_, bfboardroo0_.MAXCAPACITY as MAXCAPAC9_0_0_, bfboardroo0_.NOTES as NOTES0_0_, bfboardroo0_.CAPABILITY as CAPABILITY0_0_, bfboardroo0_.LASTUPDATE as LASTUPDATE0_0_, bfboardroo0_.UPDATEDBY as UPDATEDBY0_0_, bfboardroo0_.UPDATEDNOTES as UPDATED14_0_0_, bfboardroo0_.TELEPHONE1 as TELEPHONE15_0_0_, bfboardroo0_.TELEPHONE2 as TELEPHONE16_0_0_, bfboardroo0_.FAX as FAX0_0_, bfboardroo0_.EMAIL as EMAIL0_0_, bfboardroo0_.BOARDROOMID as BOARDRO19_0_0_ from BF_BOARDROOM bfboardroo0_ where bfboardroo0_.ID=?
Why is it making my table name "bfboardroo0" ? It shoudl be bf_boardroom.
Here's my BfBoardroom.hbm.xml file.
Code:
<?xml version="1.0" encoding='UTF-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<!-- Created Wed Aug 17 10:24:17 EDT 2005 -->
<hibernate-mapping package="ca.gc.publiservice.boardroom.hibernate">
<class name="BfBoardroom" table="BF_BOARDROOM">
<id name="id" column="ID" type="java.lang.Long">
</id>
<property name="departmentid" column="DEPARTMENTID" type="java.lang.Long" />
<property name="pendingstatus" column="PENDINGSTATUS" type="java.lang.Long" />
<property name="title" column="TITLE" type="java.lang.String" />
<property name="address" column="ADDRESS" type="java.lang.String" />
<property name="province" column="PROVINCE" type="java.lang.Long" />
<property name="city" column="CITY" type="java.lang.String" />
<property name="mincapacity" column="MINCAPACITY" type="java.lang.Long" />
<property name="maxcapacity" column="MAXCAPACITY" type="java.lang.Long" />
<property name="notes" column="NOTES" type="java.lang.String" />
<property name="capability" column="CAPABILITY" type="java.lang.String" />
<property name="lastupdate" column="LASTUPDATE" type="java.util.Date" />
<property name="updatedby" column="UPDATEDBY" type="java.lang.String" />
<property name="updatednotes" column="UPDATEDNOTES" type="java.lang.String" />
<property name="telephone1" column="TELEPHONE1" type="java.lang.String" />
<property name="telephone2" column="TELEPHONE2" type="java.lang.String" />
<property name="fax" column="FAX" type="java.lang.String" />
<property name="email" column="EMAIL" type="java.lang.String" />
<many-to-one name="bfBoardroom" column="BOARDROOMID" class="BfBoardroom" />
<set name="bfBoardroom1Set" inverse="true">
<key column="BOARDROOMID"/>
<one-to-many class="BfBoardroom"/>
</set>
</class>
</hibernate-mapping>