Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365261 - The generated SQL Add code got error when primitive key is self increased
Summary: The generated SQL Add code got error when primitive key is self increased
Status: CLOSED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-30 22:04 EST by Xin Wu CLA
Modified: 2017-02-23 14:16 EST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xin Wu CLA 2011-11-30 22:04:50 EST
Build Identifier: EDT 0.7 GM build

The generated SQL Add code got error when primitive key is self increased. The primitive key was included in generated SQL. This will cause a conflict when insert data.

Reproducible: Always

Steps to Reproduce:
1. Create a Simple table in database with primitive key self increasing. (I got the error in derby)
2. Create a Web Client with service project.And create the record from DB.
3. Write a service/program/handler to do the add operation. Just using the basic add syntax "add action_targets to data_source_expr "
4. The generated SQL insert statement in Java code will include primitive key. This will cause a conflict in runtime.
Comment 1 Xin Wu CLA 2011-12-01 20:53:40 EST
If modify the auto added SQL statement to exclude the primitive key, the generated Java code still contains the primitive key. Which will cause a column mismatch SQL error.
Comment 2 Xin Wu CLA 2011-12-14 20:36:33 EST
Found that just need to add annotation @GeneratedValue behind the PK, so closed this bug.