Hello!
I'm using McKoiDb 1.0.2 with hibernate 2.1.5 and I have problem with queries with timestamp values in where clause. Here is my code
Code:
final Query query = session
.createQuery("select sum(lines.paidBalance),sum(lines.testedBalance),sum(lines.freeBalance) "
+"from com.mrt.vend.desktop.model.Report as report join report.reportLines as lines "
+"where report.machineSetting.machine in (:machines) and report.date>=:startDate and report.date<=:endDate");
query.setParameterList("machines",infoCriteria.getMachineList());
query.setTimestamp("startDate",startCal.getTime()));
query.setTimestamp("endDate",endCal.getTime()));
List list = query.list();
this returns list with null values. I found that Mckoi requires timestamp keyword before string literal. When I execute this sql on my database:
Code:
select sum(reportline1_.rpl_paid_balance) as x0_0_, sum(reportline1_.rpl_tested_balance) as x1_0_, sum(reportline1_.rpl_free_balance) as x2_0_
from reports report0_ inner join report_lines reportline1_ on report0_.rep_id=reportline1_.rpl_rep_id, machine_settings machineset2_
where (machineset2_.mcs_mcn_id in(22 ,1802241 ,1540097) and report0_.rep_mcs_id=machineset2_.mcs_id) and (report0_.rep_date>=timestamp '2004-07-01 00:00:00' ) and (report0_.rep_date<=timestamp '2004-07-31 23:59:59' )
result set contains expected values.
Then I tried to execute following hql:
Code:
final Query query = session
.createQuery("select sum(lines.paidBalance),sum(lines.testedBalance),sum(lines.freeBalance) "
+"from com.mrt.vend.desktop.model.Report as report join report.reportLines as lines "
+"where report.machineSetting.machine in (:machines) and report.date>=timestamp :startDate and report.date<=timestamp :endDate");
query.setParameterList("machines",infoCriteria.getMachineList());
query.setTimestamp("startDate",startCal.getTime()));
query.setTimestamp("endDate",endCal.getTime()));
List list = query.list();
It seems that hibernate is unable to set named parameters because of timestamp keyword,and i get following exception.
Quote:
05 sie 2004 10:00 [AWT-EventQueue-0] DEBUG net.sf.hibernate.impl.SessionImpl - opened session
select sum(lines.paidBalance),sum(lines.testedBalance),sum(lines.freeBalance) from com.mrt.vend.desktop.model.Report as report join report.reportLines as lines where report.machineSetting.machine in (:machines) and report.date>=timestamp :startDate and report.date<=timestamp :endDate
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.impl.SessionImpl - find: select sum(lines.paidBalance),sum(lines.testedBalance),sum(lines.freeBalance) from com.mrt.vend.desktop.model.Report as report join report.reportLines as lines where report.machineSetting.machine in (:machines0_, :machines1_, :machines2_) and report.date>=timestamp :startDate and report.date<=timestamp :endDate
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.engine.QueryParameters - named parameters: {machines0_=Machine#22, machines2_=VeneziaMachine#1802241, startDate=2004-08-01 00:00:00, endDate=2004-08-31 23:59:59, machines1_=VeneziaMachine#1540097}
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.hql.QueryTranslator - compiling query
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.impl.SessionImpl - flushing session
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.impl.SessionImpl - Flushing entities and processing referenced collections
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.impl.SessionImpl - Processing unreferenced collections
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.impl.SessionImpl - Scheduling collection removes/(re)creates/updates
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.impl.SessionImpl - Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.impl.SessionImpl - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.impl.SessionImpl - Dont need to execute flush
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.hql.QueryTranslator - HQL: select sum(lines.paidBalance),sum(lines.testedBalance),sum(lines.freeBalance) from com.mrt.vend.desktop.model.Report as report join report.reportLines as lines where report.machineSetting.machine in (:machines0_, :machines1_, :machines2_) and report.date>=timestamp :startDate and report.date<=timestamp :endDate
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.hql.QueryTranslator - SQL: select sum(reportline1_.rpl_paid_balance) as x0_0_, sum(reportline1_.rpl_tested_balance) as x1_0_, sum(reportline1_.rpl_free_balance) as x2_0_ from reports report0_ inner join report_lines reportline1_ on report0_.rep_id=reportline1_.rpl_rep_id, machine_settings machineset2_ where (machineset2_.mcs_mcn_id in(? , ? , ?) and report0_.rep_mcs_id=machineset2_.mcs_id)and(report0_.rep_date>=timestamp ? )and(report0_.rep_date<=timestamp ? )
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.impl.BatcherImpl - about to open: 0 open PreparedStatements, 0 open ResultSets
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider - total checked-out connections: 0
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider - using pooled JDBC connection, pool size: 0
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.SQL - select sum(reportline1_.rpl_paid_balance) as x0_0_, sum(reportline1_.rpl_tested_balance) as x1_0_, sum(reportline1_.rpl_free_balance) as x2_0_ from reports report0_ inner join report_lines reportline1_ on report0_.rep_id=reportline1_.rpl_rep_id, machine_settings machineset2_ where (machineset2_.mcs_mcn_id in(? , ? , ?) and report0_.rep_mcs_id=machineset2_.mcs_id)and(report0_.rep_date>=timestamp ? )and(report0_.rep_date<=timestamp ? )
Hibernate: select sum(reportline1_.rpl_paid_balance) as x0_0_, sum(reportline1_.rpl_tested_balance) as x1_0_, sum(reportline1_.rpl_free_balance) as x2_0_ from reports report0_ inner join report_lines reportline1_ on report0_.rep_id=reportline1_.rpl_rep_id, machine_settings machineset2_ where (machineset2_.mcs_mcn_id in(? , ? , ?) and report0_.rep_mcs_id=machineset2_.mcs_id)and(report0_.rep_date>=timestamp ? )and(report0_.rep_date<=timestamp ? )
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.impl.BatcherImpl - preparing statement
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.engine.Cascades - id unsaved-value strategy NULL
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.type.LongType - binding '1802241' to parameter: 3
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.engine.Cascades - id unsaved-value strategy NULL
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.type.LongType - binding '22' to parameter: 1
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.type.TimestampType - binding '2004-08-01 00:00:00' to parameter: 4
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.type.TimestampType - binding '2004-08-31 23:59:59' to parameter: 5
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.engine.Cascades - id unsaved-value strategy NULL
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.type.LongType - binding '1540097' to parameter: 2
05 sie 2004 10:01 [AWT-EventQueue-0] DEBUG net.sf.hibernate.util.JDBCExceptionReporter - SQL Exception
com.mckoi.database.jdbc.MSQLException: Encountered ">= timestamp ?" at line 1, column 387.
Was expecting one of:
<REGEX_LITERAL> ...
"between" ...
"regex" ...
"not" ...
"=" ...
"==" ...
">" ...
"<" ...
">=" "(" ...
">=" "?" ...
">=" "not" ...
">=" "count" ...
">=" "trim" ...
">=" "cast" ...
">=" "if" ...
">=" "user" ...
">=" <IDENTIFIER> ...
">=" "date" ...
">=" "time" ...
">=" "timestamp" ...
">=" "timestamp" <STRING_LITERAL> ...
">=" "current_timestamp" ...
">=" "current_time" ...
">=" "current_date" ...
">=" "new" ...
">=" <STRING_LITERAL> ...
">=" <BOOLEAN_LITERAL> ...
">=" "null" ...
">=" "+" ...
">=" "-" ...
">=" <NUMBER_LITERAL> ...
">=" <QUOTED_VARIABLE> ...
">=" <DOT_DELIMINATED_REF> ...
">=" <QUOTED_DELIMINATED_REF> ...
">=" "option" ...
">=" "account" ...
">=" "password" ...
">=" "privileges" ...
">=" "groups" ...
">=" "language" ...
">=" "name" ...
">=" "java" ...
">=" "action" ...
"in" ...
">=" "any" ...
">=" "all" ...
">=" "some" ...
at com.mckoi.database.jdbcserver.AbstractJDBCDatabaseInterface.handleExecuteThrowable(AbstractJDBCDatabaseInterface.java:265)
at com.mckoi.database.jdbcserver.AbstractJDBCDatabaseInterface.execQuery(AbstractJDBCDatabaseInterface.java:479)
at com.mckoi.database.jdbcserver.JDBCDatabaseInterface.execQuery(JDBCDatabaseInterface.java:251)
at com.mckoi.database.jdbc.MConnection.executeQuery(MConnection.java:442)
at com.mckoi.database.jdbc.MConnection.executeQueries(MConnection.java:425)
at com.mckoi.database.jdbc.MStatement.executeQueries(MStatement.java:190)
at com.mckoi.database.jdbc.MStatement.executeQuery(MStatement.java:164)
at com.mckoi.database.jdbc.MPreparedStatement.executeQuery(MPreparedStatement.java:221)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:869)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:270)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:1027)
at net.sf.hibernate.loader.Loader.list(Loader.java:1018)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1544)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at com.mrt.vend.desktop.service.MachineProfitServiceImpl.selectMachineProfit(MachineProfitServiceImpl.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.avalon.activation.impl.ApplianceInvocationHandler.invoke(ApplianceInvocationHandler.java:129)
at $Proxy17.selectMachineProfit(Unknown Source)
at com.mrt.vend.desktop.command.summary.profit.GetMachineProfitInfoCommandImpl.execute(GetMachineProfitInfoCommandImpl.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.avalon.activation.impl.ApplianceInvocationHandler.invoke(ApplianceInvocationHandler.java:129)
at $Proxy16.execute(Unknown Source)
at com.mrt.vend.desktop.view.summary.SummaryViewPanel.getMachineProfitInfo(SummaryViewPanel.java:115)
at com.mrt.vend.desktop.view.summary.MachineProfitPanel.addCriteriaButtonActionPerformed(MachineProfitPanel.java:207)
at com.mrt.vend.desktop.view.summary.MachineProfitPanel.access$100(MachineProfitPanel.java:38)
at com.mrt.vend.desktop.view.summary.MachineProfitPanel$2.actionPerformed(MachineProfitPanel.java:113)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
CAUSE:
com.mckoi.database.sql.ParseException: Encountered ">= timestamp ?" at line 1, column 387.
Was expecting one of:
<REGEX_LITERAL> ...
"between" ...
"regex" ...
"not" ...
"=" ...
"==" ...
">" ...
"<" ...
">=" "(" ...
">=" "?" ...
">=" "not" ...
">=" "count" ...
">=" "trim" ...
">=" "cast" ...
">=" "if" ...
">=" "user" ...
">=" <IDENTIFIER> ...
">=" "date" ...
">=" "time" ...
">=" "timestamp" ...
">=" "timestamp" <STRING_LITERAL> ...
">=" "current_timestamp" ...
">=" "current_time" ...
">=" "current_date" ...
">=" "new" ...
">=" <STRING_LITERAL> ...
">=" <BOOLEAN_LITERAL> ...
">=" "null" ...
">=" "+" ...
">=" "-" ...
">=" <NUMBER_LITERAL> ...
">=" <QUOTED_VARIABLE> ...
">=" <DOT_DELIMINATED_REF> ...
">=" <QUOTED_DELIMINATED_REF> ...
">=" "option" ...
">=" "account" ...
">=" "password" ...
">=" "privileges" ...
">=" "groups" ...
">=" "language" ...
">=" "name" ...
">=" "java" ...
">=" "action" ...
"in" ...
">=" "any" ...
">=" "all" ...
">=" "some" ...
at com.mckoi.database.sql.SQL.generateParseException(SQL.java:5988)
at com.mckoi.database.sql.SQL.jj_consume_token(SQL.java:5857)
at com.mckoi.database.sql.SQL.OpPart(SQL.java:3194)
at com.mckoi.database.sql.SQL.expression(SQL.java:3085)
at com.mckoi.database.sql.SQL.Operand(SQL.java:3213)
at com.mckoi.database.sql.SQL.OpPart(SQL.java:3156)
at com.mckoi.database.sql.SQL.expression(SQL.java:3085)
at com.mckoi.database.sql.SQL.DoExpression(SQL.java:3055)
at com.mckoi.database.sql.SQL.ConditionsExpression(SQL.java:3040)
at com.mckoi.database.sql.SQL.GetTableSelectExpression(SQL.java:1410)
at com.mckoi.database.sql.SQL.Select(SQL.java:315)
at com.mckoi.database.sql.SQL.Statement(SQL.java:162)
at com.mckoi.database.interpret.SQLQueryExecutor.execute(SQLQueryExecutor.java:94)
at com.mckoi.database.jdbcserver.AbstractJDBCDatabaseInterface.execQuery(AbstractJDBCDatabaseInterface.java:461)
at com.mckoi.database.jdbcserver.JDBCDatabaseInterface.execQuery(JDBCDatabaseInterface.java:251)
at com.mckoi.database.jdbc.MConnection.executeQuery(MConnection.java:442)
at com.mckoi.database.jdbc.MConnection.executeQueries(MConnection.java:425)
at com.mckoi.database.jdbc.MStatement.executeQueries(MStatement.java:190)
at com.mckoi.database.jdbc.MStatement.executeQuery(MStatement.java:164)
at com.mckoi.database.jdbc.MPreparedStatement.executeQuery(MPreparedStatement.java:221)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:869)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:270)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:1027)
at net.sf.hibernate.loader.Loader.list(Loader.java:1018)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1544)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at com.mrt.vend.desktop.service.MachineProfitServiceImpl.selectMachineProfit(MachineProfitServiceImpl.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.avalon.activation.impl.ApplianceInvocationHandler.invoke(ApplianceInvocationHandler.java:129)
at $Proxy17.selectMachineProfit(Unknown Source)
at com.mrt.vend.desktop.command.summary.profit.GetMachineProfitInfoCommandImpl.execute(GetMachineProfitInfoCommandImpl.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.avalon.activation.impl.ApplianceInvocationHandler.invoke(ApplianceInvocationHandler.java:129)
at $Proxy16.execute(Unknown Source)
at com.mrt.vend.desktop.view.summary.SummaryViewPanel.getMachineProfitInfo(SummaryViewPanel.java:115)
at com.mrt.vend.desktop.view.summary.MachineProfitPanel.addCriteriaButtonActionPerformed(MachineProfitPanel.java:207)
at com.mrt.vend.desktop.view.summary.MachineProfitPanel.access$100(MachineProfitPanel.java:38)
at com.mrt.vend.desktop.view.summary.MachineProfitPanel$2.actionPerformed(MachineProfitPanel.java:113)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
and this is my mapping for com.mrt.vend.desktop.model.Report class:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class
name="com.mrt.vend.desktop.model.Report"
table="reports"
dynamic-update="false"
dynamic-insert="false"
>
<id
name="id"
column="rep_id"
type="java.lang.Long"
unsaved-value="0"
>
<generator class="net.sf.hibernate.id.TableHiLoGenerator">
</generator>
</id>
<property
name="valid"
type="java.lang.Boolean"
update="true"
insert="true"
access="property"
column="rep_valid"
not-null="true"
/>
<property
name="content"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="rep_content"
/>
<property
name="date"
type="java.util.Date"
update="true"
insert="true"
access="property"
column="rep_date"
not-null="true"
/>
<property
name="turnover"
type="java.lang.Integer"
update="true"
insert="true"
access="property"
column="rep_turnover"
/>
<many-to-one
name="employee"
class="com.mrt.vend.desktop.model.Employee"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="property"
column="rep_emp_id"
/>
<many-to-one
name="location"
class="com.mrt.vend.desktop.model.Location"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="property"
column="rep_loc_id"
not-null="true"
/>
<list
name="reportLines"
table="report_lines"
lazy="false"
inverse="false"
cascade="all"
>
<key
column="rpl_rep_id"
>
</key>
<index
column="rpl_idx"
/>
<composite-element
class="com.mrt.vend.desktop.model.ReportLine"
>
<property
name="turnover"
type="java.lang.Integer"
update="true"
insert="true"
access="property"
column="rpl_turnover"
not-null="true"
/>
<property
name="testedBalance"
type="java.lang.Integer"
update="true"
insert="true"
access="property"
column="rpl_tested_balance"
not-null="true"
/>
<property
name="freeBalance"
type="java.lang.Integer"
update="true"
insert="true"
access="property"
column="rpl_free_balance"
not-null="true"
/>
<property
name="paidBalance"
type="java.lang.Integer"
update="true"
insert="true"
access="property"
column="rpl_paid_balance"
not-null="true"
/>
<property
name="tested"
type="java.lang.Integer"
update="true"
insert="true"
access="property"
column="rpl_tested"
not-null="true"
/>
<property
name="free"
type="java.lang.Integer"
update="true"
insert="true"
access="property"
column="rpl_free"
not-null="true"
/>
<property
name="paid"
type="java.lang.Integer"
update="true"
insert="true"
access="property"
column="rpl_paid"
not-null="true"
/>
<many-to-one
name="product"
class="com.mrt.vend.desktop.model.Product"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="property"
column="rpl_prd_id"
not-null="true"
/>
</composite-element>
</list>
<property
name="reportType"
type="com.mrt.vend.desktop.model.ext.ReportTypeHbm"
update="true"
insert="true"
access="property"
column="rep_type"
not-null="true"
/>
<many-to-one
name="machineSetting"
class="com.mrt.vend.desktop.model.MachineSetting"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="property"
column="rep_mcs_id"
not-null="true"
/>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Report.xml
containing the additional properties and place it in your merge dir.
-->
</class>
</hibernate-mapping>
Can you help me?
Thanks