Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » problem with DB2 database - DB2 urgent
problem with DB2 database - DB2 urgent [message #390510] Tue, 21 July 2009 01:15
Ajay Kumar is currently offline Ajay Kumar
Messages: 13
Registered: July 2009
Junior Member
I have following relationship in the three class

----
Entity A

@Entity
@Table(name = "B")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "FIELDID", discriminatorType =
DiscriminatorType.INTEGER, length = 4)
@DiscriminatorValue(value = "0")
public class C {

-------------
----
Entity D{
@Entity
@Table(name = "E")
@AttributeOverride(name = "name", column = @Column(name = "vuiName"))
private class C
}

-------------

Following JPA query is created
SELECT v.schemaId, v.vuiId, v.vuiType, v.locale, d.label, d.propShort,
d.propLong FROM D v, C d WHERE (d.vuiId = v.vuiId) AND (d.schemaId =
v.schemaId) AND (d.fieldId = 0) ORDER BY v.schemaId

While running the above jpa QL the following two sql are created

1) is OK
[EL Fine]: 2009-07-20
22:08:49.205--ServerSession(9582794)--Connection(12851324)-- Thread(Thread[main,5,main])--SELECT
t0.SCHEMAID, t0.VUIID, t0.VUITYPE, t0.LOCALE, t1.LABEL, t1.PROPSHORT,
t1.PROPLONG FROM E t0, B t1 WHERE ((((t1.VUIID = t0.VUIID) AND
(t1.SCHEMAID = t0.SCHEMAID)) AND (t1.FIELDID = 0)) AND (t1.FIELDID = 0))
ORDER BY t0.SCHEMAID ASC
[EL Fine]: 2009-07-20
22:08:49.636--ServerSession(9582794)--Thread(Thread[main,5,m ain])--VALUES(1)
[EL Warning]: 2009-07-20
22:08:49.646--UnitOfWork(30277746)--Thread(Thread[main,5,mai n])--Exception
[EclipseLink-4002] (Eclipse Persistence Services - 1.1.2.v20090612-r4475):
org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.ibm.db2.jcc.b.SqlException: DB2 SQL error:
SQLCODE: -401, SQLSTATE: 42818, SQLERRMC: =
Error Code: -401
2) Wrong sql becasue considering fieldid as character
Call: SELECT t0.SCHEMAID, t0.VUIID, t0.VUITYPE, t0.LOCALE, t1.LABEL,
t1.PROPSHORT, t1.PROPLONG FROM E t0, B t1 WHERE ((((t1.VUIID = t0.VUIID)
AND (t1.SCHEMAID = t0.SCHEMAID)) AND (t1.FIELDID = '0')) AND (t1.FIELDID =
'0')) ORDER BY t0.SCHEMAID ASC

This issue is blocking us any suggestion.
Previous Topic:@OneToOne and @PrimaryKeyJoinColumn do not fetch the object on H2/HSQL database
Next Topic:DAO implementation: static?singleton?or instances?
Goto Forum:
  


Current Time: Wed Jul 30 19:34:01 EDT 2014

Powered by FUDForum. Page generated in 0.08803 seconds