-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: how to insert multipl row for last insert id
PostPosted: Mon Aug 26, 2013 10:57 am 
Newbie

Joined: Mon Aug 26, 2013 10:53 am
Posts: 2
I work with Struts2 , Hibernate3 and jpa I have 3 tables:
1 Evaluationglobale (id_eval ,label) 2 SousEval(id_eval ,id_sousitem), 3 SousItems(id_sousitem ,label)

How do I add a record into SousEval? i want to use the last insert ID in table Evaluationglobale for insert meny record into SousEval that i recupere this record from SousItems

I have that
Code:
id_eval       label
----------------------------
1              evaluation 1

id_sousitem     SousItem_Libelle
----------------------------
1              sousitem 1
2              sousitem 2
3              sousitem 3
4              sousitem 4


i want insert somthing like that

Code:
id_eval       id_sousitem
----------------------------
1              1
1              2
1              3
1              4


And I don't know how to recuper all id_sousitem from iterator from this jsp :

Code:
<form action="saveOrupdateSousEval" method="post">
    <TABLE  class="EvalTable" >
                <s:iterator value="item"  status="userStatus">
                <s:select  label="%{Item_Libelle}"
                headerValue="---------------- Select ---------------"
                headerKey="-1"
                name="sousEvalItem.SousItem_ID" 
                list="sousitem"
                listKey="sousitem.SousItem_ID" 
                listValue="SousItem_Libelle"
                cssClass="tdLabelwidht"
                value="%{SousItem_ID}" 
                id="EvalTable"  />
    </s:iterator>
    </TABLE>
<s:texfield type=hidden value="%{id_eval}" name="id_eval" />       
</form>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.