This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
How toPersist Value in the Tables Using Entity Bean
Rahman ziaur
Greenhorn
Joined: Mar 30, 2011
Posts: 21
posted
0
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.
Komal Renu
Ranch Hand
Joined: Jul 21, 2011
Posts: 51
posted
0
Could you please list out more details ? architecture etc
Rahman ziaur
Greenhorn
Joined: Mar 30, 2011
Posts: 21
posted
0
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........
Cor Takken
Ranch Hand
Joined: May 21, 2007
Posts: 58
posted
0
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.
SCJP 1.5
Dolphins are grey, but they dream in colour.