-->
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.  [ 2 posts ] 
Author Message
 Post subject: mapping 2 tables problem
PostPosted: Thu Jun 30, 2005 12:38 pm 
Beginner
Beginner

Joined: Thu Jun 30, 2005 5:07 am
Posts: 33
I am trying to create a new table made out 2 foriegn keys and an extra column. How ever the 2 pk is not correct. what I am doing wrong?

private Profile profile;
private Feature feature;
private String xpath;


public Kuku(){}



/**
* @return Returns the feature.
* @hibernate.id generator-class="assigned"
* @hibernate.many-to-one
* column="FEATURE_ID"
*/
public Feature getFeature() {
return feature;
}
/**
* @param feature The feature to set.
*/
public void setFeature(Feature feature) {
this.feature = feature;
}
/**
* @return Returns the profile.
* @hibernate.id generator-class="assigned"
*
* @hibernate.many-to-one
* column="PROFILE_ID"
*/
public CPProfile getProfile() {
return profile;
}
/**
* @param profile The profile to set.
*/
public void setProfile(Profile profile) {
this.profile = profile;
}
/**
* @return Returns the xpath.
* @hibernate.property
* @hibernate.column name="XPATH"
*/
public String getXpath() {
return xpath_in_cpprofile;
}

public void setXpath_in_cpprofile(String xpath) {
this.xpath= xpath;
}


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 30, 2005 1:47 pm 
Beginner
Beginner

Joined: Thu Mar 31, 2005 5:59 pm
Posts: 34
Doesn't look like a true POJO to me - the method signature:

Code:
public CPProfile getProfile()


should match the type:

Code:
public Profile getProfile()


Also, for the xpath, your methods should do the following, I'd think:

Code:
public String getXpath() {
return xpath;
}

public void setXpath(String xpath) {
this.xpath= xpath;
}


It just doesn't look like a POJO to me.


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

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.