Hi Mike, Thanks for the reply. The relationship between the two tables is a many to many. In order to do a many to many relationship in JPA you normally need a Join Table. We have only select permissions on the database and cannot create this join table.
Do you still reckon it is possible? Thanks in advance Abu Mike Horwitz wrote: > > Yes - as far as I know Hibernate does not rely on constraints being > present > in the underlying database. You will need to make sure your data is valid > though. > > Mike > > 2008/5/20 cfoy <[EMAIL PROTECTED]>: > >> >> I need to run some read only reports by joining the following two tables: >> >> 1) payments >> 2) subscriptions >> >> The join will be on a column in both called paymentreference. >> I do not have control over the underlying database and the two tables and >> the two tables do not have a relationship i.e. no foreign keys exist. >> >> Is it possible to add the relationship primary and foreign key in the >> annotations for the pojos and then use hql to perform the join even >> though >> there are no keys in the database? At the moment we are using a native >> sql >> query and using a results transformer to map the results to a pojo. >> >> I am using hibernate 3.2 annotations. >> >> Thanks in advance >> >> Abu >> -- >> View this message in context: >> http://www.nabble.com/Hibernate-hql-join-on-tables-with-no-relationship-tp17338465s2369p17338465.html >> Sent from the AppFuse - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > -- View this message in context: http://www.nabble.com/Hibernate-hql-join-on-tables-with-no-relationship-tp17338465s2369p17339849.html Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]