- This topic has 1 reply, 2 voices, and was last updated 17 years, 9 months ago by Haris Peco.
-
AuthorPosts
-
predbitMemberHi everybody,
I am using Hibernate on an Oracle DB, and I have a problem while reading from a relation table. The query correctly executes, but resultset is empty!
I try to describe the situation: I have a table for the “doctors” (or “medici”) and another for the place where they work (or “ambulatori”). The relation is many-to-many, so I have also a relation table which refers to both tables “medici” and “ambulatori”.
The auto-generated mapping maps the relation as a collection, e.g. from the mapping for the table “medici” I have the following:<bag name="ccT29CupAmbulatoriMany" table="CC_T36_CUP_MEDICI_AMB" cascade="merge"> <key foreign-key="CC_MEDICI_AMB_FK"> <column name="T36_ID_MEDICO_INT" not-null="true" length="20"/> <column name="T36_DATAINIZIOVALIDITAMED" not-null="true" length="8"/> <column name="T36_ID_UNITALOGICAMED" not-null="true" length="10"/> <column name="T36_ID_ENTEULMED" not-null="true" length="10"/> <column name="T36_DATAINIZIOVALIDITAULMED" not-null="true" length="8"/> </key> <many-to-many entity-name="it.ss.cup.model.CcT29CupAmbulatori" foreign-key="CC_AMB_MEDICI_FK"> <column name="T36_ID_AMBULATORIO" not-null="true" unique="true" index="PK_CC_T36_CUP_MEDICI_AMB" length="10"/> <column name="T36_ID_EROGATOREAMB" not-null="true" length="10"/> <column name="T36_ID_UNITALOGICAERAMB" not-null="true" length="10"/> <column name="T36_ID_ENTEULERAMB" not-null="true" length="10"/> <column name="T36_DATAINIZIOVALIDITAULERAMB" not-null="true" length="8"/> <column name="T36_DATAINIZIOVALIDITAERAMB" not-null="true" length="8"/> <column name="T36_DATAINIZIOVALIDITAAMB" not-null="true" length="8"/> </many-to-many> </bag>
The problem here is that when I try to read from the collection with the query:
from CcT35AngMediciInterni as M join M.ccT29CupAmbulatoriMany as B
from the ORM explorer, the query correctly executes, but the resultset is empty!!
Can anyone help me? What could be wrong?
Haris PecoMemberYou probably have wrong mappings.Can you send your table/pk/fks ddl (create table,primary and foreign key) ?
What tools you use ? What is ORM explorer ?
Regards,
-
AuthorPosts