Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How toPersist Value in the Tables Using Entity Bean

 
Rahman ziaur
Greenhorn
Posts: 23
Hibernate Java Spring
  • 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.
 
Komal Renu
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 Java Spring
  • 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........
 
Cor Takken
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic