File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes getting information from cascade Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "getting information from cascade" Watch "getting information from cascade" New topic

getting information from cascade

addrian brilianda

Joined: May 07, 2012
Posts: 6
I have 2 tables.. one table provide the province describe with province ID for the PK..another table have city describe where it have the coloumns of province ID.. and then i want to call the city with the specified province ID... ex call the city where province ID is 1..... how to make the queries of it with JPA and EJB??
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33130

Everything you need is in one table making it easy. You need a named query for your City entity with the province id in the where clause. Search for named queries for some examples and then post back here if you have more questions/get stuck.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: getting information from cascade
It's not a secret anymore!