I need to insert 200k records into MySQL database, using liferay service builder.
Currently it is taking 20+ minutes to process.
Is there a way to optimize this? I want to reduce processing time by 40-50%
Bulk processing and multiple values insertion is not feasible as it will require changes in configuration.
Below is the service.xml file
<entity name="table1"
table="iguv_table1" data-source="defaultdbDataSource"
local-service="true" remote-service="false" session-factory="defaultdbSessionFactory"
tx-manager="defaultdbTransactionManager">
<!-- PK Fields -->
<column name="orderNo" type="String" primary="true" />
<!-- Group instance -->
<column name="groupId" type="long" />
<!-- Audit Fields -->
<column name="companyId" type="long" />
<column name="createrUserId" type="long" />
<column name="createDate" type="Date" />
<column name="lastUpdaterUserId" type="long" />
<column name="modifiedDate" type="Date" />
<column name="approverUserId" type="long" />
<!-- Other Fields -->
<column name="rmsOrderNo" type="String" />
<column name="supplier" type="String" />
<column name="currencyCode" type="String" />
<column name="terms" type="String" />
<column name="notBeforeDate" type="Date" />
<column name="notAfterDate" type="Date" />
<column name="otbEowDate" type="Date" />
<column name="dept" type="int" />
<column name="status" type="String" />
<column name="exchangeRate" type="double" />
<column name="includeOnOrdInd" type="String" />
<column name="orderDetailsId" type="String" />
<column name="origInd" type="String" />
<column name="ediPoInd" type="String" />
<column name="preMarkInd" type="String" />
<column name="supplierName" type="String" />
<column name="hasNewItems" type="boolean" />
<column name="retryCount" type="int"></column>
<column name="successfullyPostedToRMS" type="boolean" convert-null="false"></column>
<finder name="rmsOrderNo" return-type="PurchaseOrder">
<finder-column name="rmsOrderNo" />
</finder>
<finder name="notSyncedPurchaseOrders" return-type="Collection">
<finder-column name="successfullyPostedToRMS"></finder-column>
<finder-column name="status"></finder-column>
</finder>
</entity>
Related
I have a configuration of hibernate with two tables in Mysql and the files of configuration of Pojo are the following:
<hibernate-mapping>
<class name="empresa.Departamentos" table="departamentos" catalog="empresa2" optimistic-lock="version">
<id name="deptno" type="int">
<column name="deptno" />
<generator class="assigned" />
</id>
<property name="dnombre" type="string">
<column name="dnombre" length="15" />
</property>
<property name="loc" type="string">
<column name="loc" length="15" />
</property>
<set name="empleadoses" table="empleados" inverse="true" lazy="true" fetch="select">
<key>
<column name="deptno" not-null="true" />
</key>
<one-to-many class="empresa.Empleados" />
</set>
</class>
</hibernate-mapping>
<hibernate-mapping>
<class name="empresa.Empleados" table="empleados" catalog="empresa2" optimistic-lock="version">
<id name="empno" type="short">
<column name="empno" />
<generator class="assigned" />
</id>
<many-to-one name="departamentos" class="empresa.Departamentos" fetch="select">
<column name="deptno" not-null="true" />
</many-to-one>
<property name="apellido" type="string">
<column name="apellido" length="10" />
</property>
<property name="oficio" type="string">
<column name="oficio" length="10" />
</property>
<property name="dir" type="java.lang.Short">
<column name="dir" />
</property>
<property name="fechaalt" type="date">
<column name="fechaalt" length="10" />
</property>
<property name="salario" type="java.lang.Float">
<column name="salario" precision="6" />
</property>
<property name="comision" type="java.lang.Float">
<column name="comision" precision="6" />
</property>
</class>
</hibernate-mapping>
Next, when I execute the following sentence in hql:
select e from Empleados e where e.departamentos.deptno in (select d.deptno from Departamentos d where d.loc='London')
It gives me the following error:
org.hibernate.MappingException: Association references unmapped class: empresa.Empleados
at org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2557)
at org.hibernate.cfg.HbmBinder$CollectionSecondPass.secondPass(HbmBinder.java:2808)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:70)
at org.hibernate.cfg.Configuration.originalSecondPassCompile(Configuration.java:1695)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1424)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1844)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1928)
Regards,
Javier
The solution is:
select e.apellido
from Empleados e
where e.departamentos.deptno in
(select d.deptno
from Departamentos d
where d.loc='Sevilla')
I am trying to change my application database from mysql to oracle 11g. I am using hibernate in this application but hibernate is throwing:
org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2231)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
at org.hibernate.loader.Loader.list(Loader.java:2120)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1722)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
Below is my hibernate.cfg.xml file:
*<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
<!-- <property name="hibernate.default_schema">wind</property> -->
<property name="show_sql">true</property>
<property name="hibernate.hbm2ddl.auto">validate</property>
<property name="hibernate.cache.use_second_level_cache">false</property>
<property name="hibernate.cache.use_query_cache">false</property>
<!-- <property name="connection.autoReconnect">true</property> -->
<!-- <property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">100</property>-->
<property name="hibernate.c3p0.timeout">25200</property>
<property name="hibernate.c3p0.max_statements">50</property>
<property name="hibernate.c3p0.idle_test_period">3000</property>*
I am using one config file for database url and id password.
DATABASE_URL=jdbc:oracle:thin:#localhost:1521/wind
DATABASE_USERNAME=appuser
DATABASE_PASSWORD=appuser
DATABASE_CONN_POOL_MIN=5
DATABASE_CONN_POOL_MAX=50
Mapping file:
<hibernate-mapping>
<class name="com.nsn.abc.entity.UserInfo" table="user_info" >
<id name="id" type="java.lang.Integer">
<column name="id" />
<generator class="assigned" />
</id>
<property name="username" type="string">
<column name="username" length="30" not-null="true" unique="true" />
</property>
<property name="firstName" type="string">
<column name="first_name" length="30" not-null="true" />
</property>
<property name="lastname" type="string">
<column name="lastname" length="30" />
</property>
<property name="email" type="string">
<column name="email" length="50" />
</property>
<property name="password" type="string">
<column name="password" length="30" not-null="true" />
</property>
<property name="phoneNumber" type="string">
<column name="phone_number" length="30" />
</property>
<property name="rights" type="string">
<column name="rights" length="30" not-null="true" />
</property>
<property name="counter" type="int">
<column name="counter" not-null="true" />
</property>
<property name="role" type="string">
<column name="role" length="20" />
</property>
<property name="activeFlag" type="boolean">
<column name="active_flag" not-null="true" />
</property>
<property name="info" type="string">
<column name="info" length="45" />
</property>
<set name="massProvisioningHistories" table="mass_provisioning_history" inverse="true" lazy="true" fetch="select">
<key>
<column name="user_ref" not-null="true" />
</key>
<one-to-many class="com.nsn.abc.entity.MassProvisioningHistory" />
</set>
</class>
</hibernate-mapping>
I have checked all the configuration and other details but still no progress.
Its throwing SQL Error: 923, SQLState: 42000. with ORA-00923: FROM keyword not found where expected
In the logs its genrating below query:
Hibernate: select userinfo0_.id as id25_, userinfo0_.username as username25_, userinfo0_.first_name as first3_25_, userinfo0_.lastname as lastname25_, userinfo0_.email as email25_, userinfo0_.password as password25_, userinfo0_.phone_number as phone7_25_, userinfo0_.rights as rights25_, userinfo0_.counter as counter25_, userinfo0_.role as role25_, userinfo0_.active_flag as active11_25_, userinfo0_.info as info25_ from user_info userinfo0_ where userinfo0_.username=?
Please suggest.
regards,
skr
In the application, we were using the SELECT 1 for checking the hibernate connection.
MySql supports "SELECT 1" but in oracle we need to mention "SELECT 1 from dual".
Now its working fine.
thanks for help.
I have a sql query like below,
SELECT patient.*,
contact.telephone
from patient
INNER JOIN contact ON patient.`idPatient` = contact.`idPatient`
These are my works,
Patient.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!-- Generated Sep 8, 2016 1:55:08 PM by Hibernate Tools 4.3.1 -->
<hibernate-mapping>
<class name="db.Patient" table="patient" catalog="example_hibernate" optimistic-lock="version">
<id name="idPatient" type="java.lang.Integer">
<column name="idPatient" />
<generator class="identity" />
</id>
<property name="title" type="string">
<column name="title" length="45" />
</property>
<property name="firstName" type="string">
<column name="firstName" length="45" />
</property>
<property name="lastName" type="string">
<column name="lastName" length="45" />
</property>
<property name="middleName" type="string">
<column name="middleName" length="45" />
</property>
<property name="dob" type="date">
<column name="dob" length="10" />
</property>
<property name="martitalStatus" type="java.lang.Boolean">
<column name="martitalStatus" />
</property>
<property name="gender" type="string">
<column name="gender" length="45" />
</property>
<property name="nic" type="string">
<column name="nic" length="45" />
</property>
<property name="dateCreated" type="timestamp">
<column name="dateCreated" length="19" />
</property>
<property name="lastUpdated" type="timestamp">
<column name="lastUpdated" length="19" not-null="true" />
</property>
<set name="contacts" table="contact" inverse="true" lazy="true" fetch="select">
<key>
<column name="idPatient" not-null="true" />
</key>
<one-to-many class="db.Contact" />
</set>
</class>
</hibernate-mapping>
Contact.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!-- Generated Sep 8, 2016 1:55:08 PM by Hibernate Tools 4.3.1 -->
<hibernate-mapping>
<class name="db.Contact" table="contact" catalog="example_hibernate" optimistic-lock="version">
<id name="idContact" type="java.lang.Integer">
<column name="idContact" />
<generator class="identity" />
</id>
<many-to-one name="patient" class="db.Patient" fetch="select">
<column name="idPatient" not-null="true" />
</many-to-one>
<property name="telephone" type="string">
<column name="telephone" length="45" />
</property>
<property name="address" type="string">
<column name="address" length="45" />
</property>
</class>
</hibernate-mapping>
Then I used above sql like below,
SessionFactory sessionFactory = new HibernateUtil().getSessionFactory();
Session session = sessionFactory.openSession();
List<Object[]> africanContinents = session.createQuery(
"SELECT patient.*,\n"
+ "contact.telephone\n"
+ "from patient\n"
+ "INNER JOIN contact ON patient.`idPatient` = contact.`idPatient`")
.list();
HibernateUtil.shutdown();
But this bought me following exception
org.hibernate.QueryException: unexpected char: '`' [SELECT patient.*,
contact.telephone
from patient
INNER JOIN contact ON patient.`idPatient` = contact.`idPatient`]
I have no idea about how to handle this exception . Because this sql query is correct.
Have any ideas about this exception ?
The query in createQuery should be written in HQL or JPQL.
So you could rewrite your query in HQL (something 'like select p,c.telephone from patient inner join contact') see documentation here
Or you could use your SQL query by calling session.createSQLQuery instead of session.createQuery
Hope this helps.
Sebastien
I try to insert a row into mysql using liquibase in a spring-boot app. Something similar to this:
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">
<changeSet author="laxika" id="20160508-2">
<insert tableName="news">
<column name="title" value="Hello world"/>
<column name="release_date" value="2016-05-09 00:00:00"/>
<column name="icon" value="update"/>
<column name="message" value="
a
b
c
d
"/>
</insert>
</changeSet>
</databaseChangeLog>
For some strange reason liquibase doesn't add newlines to the sql properly so I end up having one long string in the db. How can I force liquibase to insert with newlines?
Here is the schema for the table I'm trying to insert into:
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">
<changeSet author="laxika" id="20150922-4">
<createTable tableName="news">
<column name="id" type="smallint unsigned" autoIncrement="true">
<constraints primaryKey="true" nullable="false" />
</column>
<column name="release_date" type="date">
<constraints nullable="false" />
</column>
<column name="title" type="varchar(256)">
<constraints nullable="false" />
</column>
<column name="message" type="varchar(2048)">
<constraints nullable="false" />
</column>
<column name="icon" type="varchar(32)">
<constraints nullable="false" />
</column>
</createTable>
<modifySql>
<append value="ENGINE=INNODB DEFAULT CHARSET=utf8"/>
</modifySql>
</changeSet>
</databaseChangeLog>
I tried all above answers, eventually I see an answer on the community forum of liquibase which has the answer:
<column name="message"><![CDATA[
a
b
c
d
]]></column>
Try usind CDATA in the XML :
<column name="message" value="<![CDATA[
a
b
c
d
]]>"/>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">
<changeSet author="laxika" id="20160508-2">
<insert tableName="news">
<column name="title" value="Hello world"/>
<column name="release_date" value="2016-05-09 00:00:00"/>
<column name="icon" value="update"/>
<column name="message" valueComputed="(SELECT '\na\nb\nc\nd\n' from dual)"/>
</insert>
</changeSet>
</databaseChangeLog>
Worked for me:
<insert tableName="AUDIT_ATTR">
<column name="AUDIT_ID" valueNumeric="601"/>
<column name="KEY" value="FINDINGS_IN_CATEGORY_NCW_TEXT"/>
<column name="VALUE">
tra1
la2
la3
</column>
</insert>
I am trying to learn how to use hibernate and have run into a problem I have been stuck on for a while.
I am trying to join two tables together and display the values in a GUI form. I have tried researching for an answer but my case seems to be different then others listed. It seems to be a problem with the relationship between the ids of each table.
Here is the only statement I can get to display any results but it basically displays the same GameTemplates table twice.
Close as I can get:
from GameTemplates gt join gt.id.partNum Tickets
Desired SQL:
select * from Game_Templates
inner join Tickets
where
Game_Templates.part_Num = Tickets.game_Templates_Part_Num
GameTemplates.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!-- Generated Sep 8, 2015 7:01:43 PM by Hibernate Tools 4.3.1 -->
<hibernate-mapping>
<class name="entity.GameTemplates" table="game_templates" catalog="fire_tickets">
<composite-id name="id" class="entity.GameTemplatesId">
<key-property name="partNum" type="string">
<column name="part_num" length="12" />
</key-property>
<key-property name="distsIdDistId" type="int">
<column name="dists_id_dist_id" />
</key-property>
<key-property name="mfgIdMfgId" type="int">
<column name="mfg_id_mfg_id" />
</key-property>
</composite-id>
<many-to-one name="distsId" class="entity.DistsId" update="false" insert="false" fetch="select">
<column name="dists_id_dist_id" not-null="true" />
</many-to-one>
<many-to-one name="mfgId" class="entity.MfgId" update="false" insert="false" fetch="select">
<column name="mfg_id_mfg_id" not-null="true" />
</many-to-one>
<property name="gameName" type="string">
<column name="game_name" length="20" />
</property>
<property name="gameCost" type="java.lang.Double">
<column name="game_cost" precision="22" scale="0" />
</property>
<property name="ticketCost" type="java.lang.Double">
<column name="ticket_cost" precision="22" scale="0" />
</property>
<property name="numTickets" type="java.lang.Integer">
<column name="num_tickets" />
</property>
<property name="ideaGross" type="java.lang.Integer">
<column name="idea_gross" />
</property>
<property name="ideaPrizes" type="java.lang.Integer">
<column name="idea_prizes" />
</property>
<property name="ideaNet" type="java.lang.Integer">
<column name="idea_net" />
</property>
<property name="lastSale" type="java.lang.Integer">
<column name="Last_sale" />
</property>
<property name="lastSaleAllow" type="java.lang.Integer">
<column name="Last_sale_allow" />
</property>
<property name="prizeAmt1" type="java.lang.Integer">
<column name="Prize_amt1" />
</property>
<property name="prizeAmt2" type="java.lang.Integer">
<column name="Prize_amt2" />
</property>
<property name="prizeAmt3" type="java.lang.Integer">
<column name="Prize_amt3" />
</property>
<property name="prizeAmt4" type="java.lang.Integer">
<column name="Prize_amt4" />
</property>
<property name="prizeAmt5" type="java.lang.Integer">
<column name="Prize_amt5" />
</property>
<property name="prizeAmt6" type="java.lang.Integer">
<column name="Prize_amt6" />
</property>
<property name="prizeAmt7" type="java.lang.Integer">
<column name="Prize_amt7" />
</property>
<property name="prizeAmt8" type="java.lang.Integer">
<column name="Prize_amt8" />
</property>
<property name="prizeAmt9" type="java.lang.Integer">
<column name="Prize_amt9" />
</property>
<property name="prizeAmt10" type="java.lang.Integer">
<column name="Prize_amt10" />
</property>
<property name="prizeAmt11" type="java.lang.Integer">
<column name="Prize_amt11" />
</property>
<property name="prizeAmt12" type="java.lang.Integer">
<column name="Prize_amt12" />
</property>
<property name="prizeAmt13" type="java.lang.Integer">
<column name="Prize_amt13" />
</property>
<property name="prizeAmt14" type="java.lang.Integer">
<column name="Prize_amt14" />
</property>
<property name="prizeAmt15" type="java.lang.Integer">
<column name="Prize_amt15" />
</property>
<property name="prizeAll1" type="java.lang.Integer">
<column name="Prize_all1" />
</property>
<property name="prizeAll2" type="java.lang.Integer">
<column name="Prize_all2" />
</property>
<property name="prizeAll3" type="java.lang.Integer">
<column name="Prize_all3" />
</property>
<property name="prizeAll4" type="java.lang.Integer">
<column name="Prize_all4" />
</property>
<property name="prizeAll5" type="java.lang.Integer">
<column name="Prize_all5" />
</property>
<property name="prizeAll6" type="java.lang.Integer">
<column name="Prize_all6" />
</property>
<property name="prizeAll7" type="java.lang.Integer">
<column name="Prize_all7" />
</property>
<property name="prizeAll8" type="java.lang.Integer">
<column name="Prize_all8" />
</property>
<property name="prizeAll9" type="java.lang.Integer">
<column name="Prize_all9" />
</property>
<property name="prizeAll10" type="java.lang.Integer">
<column name="Prize_all10" />
</property>
<property name="prizeAll11" type="java.lang.Integer">
<column name="Prize_all11" />
</property>
<property name="prizeAll12" type="java.lang.Integer">
<column name="Prize_all12" />
</property>
<property name="prizeAll13" type="java.lang.Integer">
<column name="Prize_all13" />
</property>
<property name="prizeAll14" type="java.lang.Integer">
<column name="Prize_all14" />
</property>
<property name="prizeAll15" type="java.lang.Integer">
<column name="Prize_all15" />
</property>
</class>
</hibernate-mapping>
Tickets.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!-- Generated Sep 8, 2015 7:01:43 PM by Hibernate Tools 4.3.1 -->
<hibernate-mapping>
<class name="entity.Tickets" table="tickets" catalog="fire_tickets">
<composite-id name="id" class="entity.TicketsId">
<key-property name="serial" type="string">
<column name="Serial" length="12" />
</key-property>
<key-property name="gameTemplatesPartNum" type="string">
<column name="game_templates_part_num" length="12" />
</key-property>
</composite-id>
<property name="datePlaced" type="date">
<column name="Date_placed" length="10" />
</property>
<property name="dateRemoved" type="date">
<column name="Date_removed" length="10" />
</property>
<property name="unsoldAmt" type="java.lang.Integer">
<column name="Unsold_amt" />
</property>
<property name="actualGross" type="java.lang.Integer">
<column name="Actual_gross" />
</property>
<property name="actualPrizes" type="java.lang.Integer">
<column name="Actual_prizes" />
</property>
<property name="actualNet" type="java.lang.Integer">
<column name="Actual_net" />
</property>
<property name="bin" type="java.lang.Integer">
<column name="Bin" />
</property>
<property name="inplay" type="java.lang.Boolean">
<column name="Inplay" />
</property>
<property name="closed" type="java.lang.Integer">
<column name="Closed" />
</property>
<property name="unsoldTickets" type="java.lang.Integer">
<column name="Unsold_tickets" />
</property>
<property name="lastSaleRem" type="java.lang.Byte">
<column name="Last_sale_rem" />
</property>
<property name="prizeRem1" type="java.lang.Integer">
<column name="Prize_rem1" />
</property>
<property name="prizeRem2" type="java.lang.Integer">
<column name="Prize_rem2" />
</property>
<property name="prizeRem3" type="java.lang.Integer">
<column name="Prize_rem3" />
</property>
<property name="prizeRem4" type="java.lang.Integer">
<column name="Prize_rem4" />
</property>
<property name="prizeRem5" type="java.lang.Integer">
<column name="Prize_rem5" />
</property>
<property name="prizeRem6" type="java.lang.Integer">
<column name="Prize_rem6" />
</property>
<property name="prizeRem7" type="java.lang.Integer">
<column name="Prize_rem7" />
</property>
<property name="prizeRem8" type="java.lang.Integer">
<column name="Prize_rem8" />
</property>
<property name="prizeRem9" type="java.lang.Integer">
<column name="Prize_rem9" />
</property>
<property name="prizeRem10" type="java.lang.Integer">
<column name="Prize_rem10" />
</property>
<property name="prizeRem11" type="java.lang.Integer">
<column name="Prize_rem11" />
</property>
<property name="prizeRem12" type="java.lang.Integer">
<column name="Prize_rem12" />
</property>
<property name="prizeRem13" type="java.lang.Integer">
<column name="Prize_rem13" />
</property>
<property name="prizeRem14" type="java.lang.Integer">
<column name="Prize_rem14" />
</property>
<property name="prizeRem15" type="java.lang.Integer">
<column name="Prize_rem15" />
</property>
<property name="datePurch" type="date">
<column name="date_purch" length="10" />
</property>
<property name="invoiceNum" type="string">
<column name="invoice_num" length="10" />
</property>
</class>
</hibernate-mapping>
Try this:
from GameTemplates gt, Tickets t where gt.id.partNum = t.id.gameTemplatesPartNum