• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

How to link existing record from database table in ManyToMany Uni-directional relationship

 
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Forum members,

I would like some advice on how to associate/reference existing entities from database in a ManyToMany Uni-directional between County and School entities relationship. Below is the CountyBean.createCounty(County) which replaces any School records passed through County parameter with those already exist in SCHOOL table:


It is on line 17 of CountyBean where I want to only associate/link an existing School from DB with current County, instead of generating an additional duplicate School record in order to keep SCHOOL table normalize.

Your suggestion would be very much welcome.

Many thanks,

Jack
 
Jack Bush
Ranch Hand
Posts: 235
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,

Is there anyone out there who can help me with this question? Am I on the wrong track altogether?

Thanks,

Jack
 
today's feeble attempt to support the empire
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic