-->
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: plz help me
PostPosted: Thu Dec 20, 2007 5:03 am 
Newbie

Joined: Thu Dec 20, 2007 4:55 am
Posts: 1
Hello Everybody ,

I am new to this forum .Actually I am using table per sub class concept in hibernate.

i am pasting my pojo information and hbm.xml information here plz suggest me where i did mistake ?

here below i pasted the information. Subclass is userserviceprovider I need to update the userserviceprovider table using userid(foreign key ) it belongs to user table. I am not using primarykey of userserviceprovider table for update

Plz tel me what is the mistake in hbm file

this is super class......

public class User implements Serializable{

public static final String INDIVIDUAL = "individual";
public static final String NGO = "ngo";
public static final String SERVICE_PROVIDER = "serviceprovider";
public static final String ADMIN = "admin";

// ----------------------------------------------------
// NOTE: Whenever you add a new state to User, remember
// to add it setUser() API. It's used by Searching API.
// ----------------------------------------------------
private Long userId;
private String password;
private String email;
private String headLines;
private String website;
private String status;
private String screenName;
private String type;
private String token;
private int spamCount;
private String homeTown;
private UserAddress userAddress;
private Date dateCreated;
private String createdBy;
private Date dateModified;
private String modifiedBy;

public User() {

}


this is sub class of user.

public class UserServiceProvider extends User {

//Member variables

private Long serviceprovid;

private String companyName;

private String contactName;

private String phoneno;

private ArrayList specialitiesList;

private String website;

private String instantMessagingIds;

private String showImIds;

private ArrayList serviceProvidedList;

private String otherServicesProvided;

private List<String> speciliaties;

private String otherSpecialities;

private String companyProfile;

private String moreInformation;

private String yearfounded;

private String keywords;

private String messagealert;

private String newsletter;

private String certificate;

private List<String> travelStyle;

private String travelStylesAsString;

private String otherTravelStyle;

private List<String> serviceProvided;

private String serviceProvideAsString;


this is hbm file for userserviceprovider.

<class name="com.zicasso.model.entity.user.UserServicePro vider" table="zicasso_user_service_provider" >

<id name="userId" column = "user_id" > here userid is in user table. i need to store into zicasso_user_service_provider table.

how to map plz check it . And user_id is the foreignkey in this table. I am not using primary key to update this table.


<!-- MySQL generator for a increment field -->

<generator class="identity"/>


</id>

<property name="companyName" column="company_name"></property>

<property name="contactName" column="contact_name" ></property>

<property name="phoneno" column="phone_no" ></property>

<property name="website" column="website" ></property>

<property name="instantMessagingIds" column="im_id" ></property>

<property name="serviceProvidedAsString" column="service_provided" ></property>

<property name="otherServicesProvided" column="other_service_provided" ></property>

<property name="speciliatieAsString" column="specialities" ></property>

<property name="otherSpecialities" column="other_specialities" ></property>

<property name="companyProfile" column="company_profile" ></property>

<property name="moreInformation" column="more_information"></property>

<property name="yearfounded" column="year_founded" ></property>

<property name="keywords" column="key_words" ></property>

<property name="certificate" column="certificate" ></property>

<property name="travelStyleAsString" column="travel_style" ></property>

<property name="otherTravelStyle" column="other_travel_style" ></property>


</class>

_________________
Mahathi


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.