• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

How toPersist Value in the Tables Using Entity Bean

 
Greenhorn
Posts: 23
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Creativity is allowing yourself to make mistakes; art is knowing which ones to keep. Keep this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic