-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Mapping a Table with a Materialized View without primary key
PostPosted: Mon Jan 19, 2009 3:22 pm 
Newbie

Joined: Mon Jan 19, 2009 2:59 pm
Posts: 1
Hi for all.
Like i have wrote in the title, i would map a table with a materialized View.
The difficult for me is that i would use not the primary key but another arbitrary key in the Table.
To explain in a better way i'll do an example.
Suppose to have the Table

User, with fields:

userId(PK), firstname, secondname and address;

and a materialized view called commonData that has the fields:

address, zipcode, country.

So i would map User to Address with an association one(User) many(CommonData), that map the address of a User with the equal addresses of commonData.
I cannot have a Primary Key in CommonData.

Is in some way possible map It?

<hibernate-mapping>
<class name="User" table="USER">
<id name="userid" unsaved-value="0">
<generator class="increment"/>
</id>

????CommonData????
..........


<property name="name" type="string"/>
</class>
<class name="CommonData"
table="COMMONDATA">
<property name="address" column="ADDRESS"/>
<property name="zipcode" column="ZIPCODE"/>
<property name="country" column="COUNTRY"/>
</class>
</hibernate-mapping>


Thanks in advance


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.