Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356038 - Default SQL Generation for ADD,GET,REPLACE,DELETE SQL statement actions
Summary: Default SQL Generation for ADD,GET,REPLACE,DELETE SQL statement actions
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Zhi Zhu CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-28 22:28 EDT by Zhi Zhu CLA
Modified: 2017-02-23 14:15 EST (History)
5 users (show)

See Also:


Attachments
Framework support for sql edit (25.98 KB, patch)
2011-09-07 21:45 EDT, Xiao Bin Chen CLA
lasher: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zhi Zhu CLA 2011-08-28 22:28:49 EDT
Build Identifier: Source Editor - SQL Statement (Add, Add with Into, View, Validate, Remove, Reset)

Source Editor - SQL Statement (Add, Add with Into, View, Validate, Remove, Reset)

Reproducible: Always
Comment 1 Zhi Zhu CLA 2011-08-29 02:41:44 EDT
More detailed description about this feature.

  Assume I have a record:
    record Item type sqlRecord { 
        tablenames=[["EGL.ITEM"]],
        fieldsMatchColumns = yes,
        keyItems=[ITEM_ID]
    }  

	ITEM_ID int             	{column="ITEM_ID"};
	NAME string             	{column="NAME", maxLen=22};
	IMAGE string            	{column="IMAGE", isSqlNullable=yes, maxLen=22};
	PRICE decimal(7,2)      	{column="PRICE", isSqlNullable=yes};
	DESCRIPTION string      	{column="DESCRIPTION", isSqlNullable=yes, maxLen=122};
end


   and an EGL variable whose type is Item:
     newRecord Item


  Function AddItem(newRecord Item, status StatusRec)
     add newRecord;
  end;


  When my mouse pointed at somewhere " add newRecord;", using SQL Statement --> Add
  will add the below SQL statement to " add newRecord;", and get:

   add newRecord with
					#sql{
						insert into EGL.ITEM
							(ITEM_ID, NAME, IMAGE, PRICE, DESCRIPTION)
						values
							(:newRecord.ITEM_ID, :newRecord.name, :newRecord.Image, 
							:newRecord.PRICE, :newRecord.DESCRIPTION)
					};



Other actions are similar to this one
Comment 2 Lisa Lasher CLA 2011-08-30 16:36:58 EDT
changing from defect to enhancement.
Comment 3 Will Smythe CLA 2011-09-01 10:10:38 EDT
As discussed, this should be implemented with content assist. Need to come up with a design for what needs to be implemented and the priorities.
Comment 4 Tony Chen CLA 2011-09-05 01:11:20 EDT
Instead of Content Assist, Quick Assist might be a better choice to implement this function. Quick Assists are proposals available even if there is no problem or warning. They use the same short cut and action like Quick Fix. Quick assists are used for local code manipulations. See the Quick assist reference for more information.

http://help.eclipse.org/indigo/topic/org.eclipse.jdt.doc.user/reference/ref-java-editor-quickassist.htm




(In reply to comment #3)
> As discussed, this should be implemented with content assist. Need to come up
> with a design for what needs to be implemented and the priorities.
Comment 5 Xiao Bin Chen CLA 2011-09-07 21:45:21 EDT
Created attachment 202952 [details]
Framework support for sql edit
Comment 6 Zhi Zhu CLA 2011-09-15 01:05:02 EDT
fix it
offer Add SQL/Add SQL With Into/Remove SQL/Reset SQL using content assist style.
only support basic record type.
Comment 7 Zhi Zhu CLA 2011-09-15 02:12:03 EDT
reopen for more testing based on new spec
Comment 8 Zhi Zhu CLA 2011-09-20 04:47:59 EDT
Please refer to bug 355573 for SQL Spec
Comment 9 Zhi Zhu CLA 2011-09-21 03:39:37 EDT
1 Add Using Clause in default SQL generation, for using clause please refer to EXECUTE semantics

2. Quick Assist Cursor problem
Comment 10 Zhi Zhu CLA 2011-09-25 22:33:33 EDT
Complete default SQL generation for simple scenarios

for complex ones, please refer to bug 358837
Comment 11 Zhi Zhu CLA 2011-10-09 21:13:35 EDT
close it