Inheritance concept in jpa

Posted by megala on Stack Overflow See other posts from Stack Overflow or by megala
Published on 2010-03-25T07:23:20Z Indexed on 2010/03/25 7:43 UTC
Read the original article Hit count: 355

Filed under:

I created one table using Inheritance concept to sore data into google app engine datastore. It contained following coding but it shows error.How to user Inheritance concept.What error in my program

Program 1:

@Entity

@Inheritance(strategy=InheritanceType.JOINED)

public class calender { @Id

private String EmailId;

@Basic
private String CalName;
@Basic


public void setEmailId(String emailId) {

    EmailId = emailId;

}
public String getEmailId() {

    return EmailId;

}

public void setCalName(String calName) {

    CalName = calName;

}

public String getCalName() {

    return CalName;

}


public calender(String EmailId,String CalName)

{

    this.EmailId=EmailId;

    this.CalName=CalName;


}

}

program 2:

@Entity

public class method {

@Id

private String method;

public void setMethod(String method) {

    this.method = method;
}

public String getMethod() {

    return method;

}
public method(String method)

{

    this.method=method;

}

}

My constraint is I want ouput like this

Calendertable coantain

Emailid

calenername

and method table contain

Emailid

method

How to achive this?

thanks inadvance.

© Stack Overflow or respective owner

Related posts about jpa