Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

jpa delete

HjavaDec 15 2010 — edited Dec 16 2010
String Click = req.getParameter("delete") == null ? "" : req.getParameter("delete").trim();
//out.print(Click);
int position=Click.indexOf('/');
String temp=Click.substring(0, position);

try {

em.getTransaction().begin();

Query query=em.createQuery("delete from PaymentRecords pm where pm.UserId= ?id");

query.setParameter("id", temp);
entr.commit();
did not do the delete. thank

Edited by: Hjava on Dec 15, 2010 1:18 AM

Edited by: Hjava on Dec 15, 2010 2:24 AM
I get error on unknow associate field in UserId , my userid is not the Pk for my student
@JoinColumn(name = "UserId", referencedColumnName = "UserId")
@ManyToOne(optional = false)
private student student;
I have the userId in my table but not in my entity class PaymentRecords !!! what should I do in this situition?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 13 2011
Added on Dec 15 2010
1 comment
224 views