panki vijay

Greenhorn
+ Follow
since Oct 06, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by panki vijay

Hi Every buddy
I am getting problem in ManyToOne Relationship.I am not getting that how to call entity.persist()from client.Because there will be two object of owing side class.
My proble is like this....

public class Person implements Serializable {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name = "ID", nullable = false)
private Long id;
@ManyToOne(cascade={CascadeType.ALL})

@JoinTable(name="Cu_Ad",
joinColumns={@JoinColumn(name="CustomerID")},
inverseJoinColumns={@JoinColumn(name="AddressID")})
private Address address=new Address();
...
}

public class Address implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name = "ID", nullable = false)
private BigDecimal id;
.....
}

Client Or servlet{

String fname=request.getParameter("fname");
String lname=request.getParameter("lname");
String city=request.getParameter("city");
String country=request.getParameter("country");

Address d=new Address();
d.setCountry(country);
d.setCity(city);

Pankaj p1=new Pankaj();
p1.setFirstname(fname);
p1.setLastname(lname);
p1.setAddress(d);

Pankaj p2=new Pankaj();
p2.setFirstname(fname);
p2.setLastname(lname);
p2.setAddress(d);

remote.CreateCruise(p1); remote.CreateCruise(p2);
}

My problem is i want in peson table two persons should be created whilw in Address table one value should go.
just please tell me wats worng in servlet class.
@OneToMany realtionship is working properly but this isn't.


I just want to create two pesons in person table & one address in Address table. please help me.........


hi all
@Inheritance(strategy=InheritanceType.JOINED)
is working fine .But in second subclassif i am trying to use @PrimaryKeyJoinColumn(name="EMP_PK") then on error message is coming on ID that ---
An Entity subclass can't have IdClass it will result in mutiple ID's in the entity hierarchy.
need help......
class hierarchy is like this...

@Inheritance(strategy=InheritanceType.JOINED)
class A{}
class B extends A{}
@PrimaryKeyJoinColumn(name="EMP_PK")
class C extends B{}
[Removed illegal content - Christophe]
[ November 17, 2008: Message edited by: Christophe Verre ]
My this problem is solved...
[ November 18, 2008: Message edited by: Ulf Dittmer ]
hi all
I want to knoe that wat the mean of @GenratedValue anotation in EJB3.0.according to Orelly book this will allow the provider to auto genrate the primary key.but its not happening.if i am not genrating primary key manually then database is not going to affect.
& also wats the use of Primary Key class.
Pleae help...
Thanks
[ November 03, 2008: Message edited by: panki vijay ]
Thanks to all...
please also tell me that is it ok to go for ejb2.0 certification.
Hiii...all
I want to know that is it ok to go for ejb2.0. if NO. then which book i should prefer.I have knowledge of ejb2.0 but i am not finding any good book for ejb3.0.
mastering in EJB is good book OR Enterprise java bean.which book i should prefer.
only one book is sufficient for scbcd or i should go threw other books also.
please help......
Hiii...
I want to know that is it ok to go for ejb2.0. if NO. then which book i should prefer.I have knowledge of ejb2.0 but i am not finding any good book for ejb3.0.
mastering in EJB is good book OR Enterprise java bean.which book i should prefer.
only one book is sufficient for scbcd or i should go threw other books also.
please help......
15 years ago