From [E-MAIL ADDRESS DELETED] Thu Jun 28 12:55:23 2007 From: [E-MAIL ADDRESS DELETED] (tran nguyet) Date: Wed, 27 Jun 2007 20:55:23 -0700 (PDT) Subject: [seasar-user-en:36] How to get ID after insert ? Message-ID: <326720.32815.qm@web52001.mail.re2.yahoo.com> Hi All, I'm using s2sao.net 1.0.4 , and this is my problem. After inserting an object into table, I want to get back the ID which is automatically generated by using sequence. Then I try to use s2dao method like this "Function AddEmp(employee As Employee) As Integer", but the return Integer is always 1, not the real ID. Could you help me to solve this problem. Thanks in advance. MinhNguyet --------------------------------- Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://ml.seasar.org/archives/seasar-user-en/attachments/20070627/b866cfe4/attachment.html From [E-MAIL ADDRESS DELETED] Fri Jun 29 06:02:31 2007 From: [E-MAIL ADDRESS DELETED] (Kazuya Sugimoto) Date: Fri, 29 Jun 2007 06:02:31 +0900 Subject: [seasar-user-en:37] Re: How to get ID after insert ? In-Reply-To: <326720.32815.qm@web52001.mail.re2.yahoo.com> References: <326720.32815.qm@web52001.mail.re2.yahoo.com> Message-ID: Hi The return value becomes an additional number. ID is acquired as follows. After insert. AddEmp(employee) Dim id As Integer = employee.EmployeeID However, it is necessary to execute it in the transaction. 2007/6/28, tran nguyet <[E-MAIL ADDRESS DELETED]>: > Hi All, > > I'm using s2sao.net 1.0.4 , and this is my problem. > > After inserting an object into table, I want to get back the ID which is > automatically generated by using sequence. Then I try to use s2dao method > like this "Function AddEmp(employee As Employee) As Integer", but the return > Integer is always 1, not the real ID. > Could you help me to solve this problem. > > Thanks in advance. > > MinhNguyet > > > > ________________________________ > Boardwalk for $500? In 2007? Ha! > Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! > Games. > > > _______________________________________________ > seasar-user-en mailing list > [E-MAIL ADDRESS DELETED] > https://ml.seasar.org/mailman/listinfo/seasar-user-en > > -- Kazuya Sugimoto Microsoft MVP Visual Developer - Solutions Architect http://d.hatena.ne.jp/sugimotokazuya/ From [E-MAIL ADDRESS DELETED] Fri Jun 29 06:15:24 2007 From: [E-MAIL ADDRESS DELETED] (Kazuya Sugimoto) Date: Fri, 29 Jun 2007 06:15:24 +0900 Subject: [seasar-user-en:38] Re: How to get ID after insert ? Message-ID: Hi The return value becomes an additional number. ID is acquired as follows. After insert. AddEmp(employee) Dim id As Integer = employee.EmployeeID However, it is necessary to execute it in the transaction. 2007/6/28, tran nguyet <[E-MAIL ADDRESS DELETED]>: > Hi All, > > I'm using s2sao.net 1.0.4 , and this is my problem. > > After inserting an object into table, I want to get back the ID which is > automatically generated by using sequence. Then I try to use s2dao method > like this "Function AddEmp(employee As Employee) As Integer", but the return > Integer is always 1, not the real ID. > Could you help me to solve this problem. > > Thanks in advance. > > MinhNguyet -- Kazuya Sugimoto Microsoft MVP Visual Developer - Solutions Architect http://d.hatena.ne.jp/sugimotokazuya/