This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

How toPersist Value in the Tables Using Entity Bean

 
Greenhorn
Posts: 23
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All Suppose i have two table Parent and child.
Parent table having one Primary key and my Child table contaion child_id as primary key and Parent_id as foriegn key.
There is oneto Many relationship among my tables.
Please help me i could i save the value in Child table for foriegn key.
I am able to persist value in Parent table but not able in Child table.Is it any way through which i insert in parent and its automaticaaly reflect on Child table.


Any suggestion,help must be Appreciated.
Thanks in Advance.
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please list out more details ? architecture etc
 
Rahman ziaur
Greenhorn
Posts: 23
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two table--
1-[code=javaCREATE TABLE `ttdb`.`competence` (
`competence_id` int(10) unsigned NOT NULL auto_increment,
`competence_name` varchar(45) NOT NULL,
`competence_desc` varchar(100) default NULL,
`competence_status` varchar(45) NOT NULL,PRIMARY KEY (`competence_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;[/code]


2nd table is---


and i have two Entity class for them...

i have two method
one to CreateCompetence and another for createCompetencESection.

So how i can insert the value in the Refrence key Table.

Kindly give me the logic how to write function logic for
CreateCompetenceSection........
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can clarify your question even more if you can show us the code snippet showing where you persist your parent and particularly where you place the child "in" the parent... And perhaps some of the setter methods of the child, but that depends on how how link the child to the parent.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!