Hi,
Iam a newbie to Hibernate..Iam trying some example which iam not able to do.pls help.
I hve 2 tables:
Person (pid ,firstName)-->(mapped to class Person)
Contact(cid,info)-->(mapped to class Contact)
_____________________________________
<hibernate-mapping>
<class name="Contact" table="Contact">
<id name="cid" type="int" column="cid" >
<generator class="assigned"/>
</id>
<property name="info">
<column name="info" />
</property>
</hibernate-mapping>
__________________________________________
<hibernate-mapping>
<class name="Person" table="Person">
<id name="pid" type="int" column="pid" >
<generator class="assigned"/>
</id>
<property name="firstName">
<column name="firstName" />
</property>
</hibernate-mapping>
_______________________________
There is no relation b/w the two tables,i want to run a query:
select cid,info from Contact as contact, Person as person where contact.cid=person.pid;
My dbt is there is no join b/w the two tables and no primary key n foreign key relationship.Iam not able to execute this query..Any help abt wht to do will be grtly appreciated..
Thnx.
Mysha.
|