Bug 126152 - [xdoclet] CMP wizard: invalid @ejb.bean tag "data-source"
Summary: [xdoclet] CMP wizard: invalid @ejb.bean tag "data-source"
Status: CLOSED WONTFIX
Alias: None
Product: WTP EJB Tools
Classification: WebTools
Component: jst.ejb (show other bugs)
Version: 1.0.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: Future   Edit
Assignee: jst.ejb CLA
QA Contact: Kaloyan Raev CLA
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2006-02-02 04:31 EST by Wolfgang Knauf CLA
Modified: 2012-11-26 11:42 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Knauf CLA 2006-02-02 04:31:31 EST
The newly integrated wizard for entity beans creates a xdoclet tag "data-source", which is not mentioned in the doc (XDoclet 1.2.3). Seems invalid to me.

Some improvement suggestions to the entity bean wizard:
a) default values for "DataSource" and "Schema" don't change with bean name ("My" and "MYSCHEMA"). 
b) comment is "a session bean named XYZ" 
c) What is the "Datasource" field for ? 
d) "Usecase" combo: To me it was not clear that "Create from JavaBean" means that I can specify all fields. Wouldn't it be better to call it "Specifiy CMP attributes manually" ?
e) in step "CMP attributes": Tablename could have a default value.
f) in step "CMP attributes": better sync of the field types: JDBC type and SQL type should be synchronized (if I pick "INTEGER" in one field it could be selected in the following field, too). At least from left to right.
g) in step "CMP attributes", column "SQL Type": is it allowed to specify e.g. field lengths for VARCHAR fields ("VARCHAR(100)")? The UI does not allow editing in this table column.

That's all for the first glance ;-).
Comment 1 Naci Dai CLA 2006-02-03 04:39:08 EST
wolfgang, thank you for reviewing the wizard.  We'll do a second pass this week and  would be interested in hearing your comments.
Comment 2 Jeffrey Liu CLA 2006-03-09 04:01:59 EST
Since 1.5 M5 was declared, I am changing the target of this bug to 1.5 M6. Feel free to retarget it if necessary. Thanks.
Comment 3 Naci Dai CLA 2006-06-02 00:08:39 EDT
1) Datasource tag has been moved to runtime specific tags and to preferences dialogs for jboss/websphere/weblogic/etc. has a property for it now. It has been deleted from the wizard.

2) Varibale length fields will have a default length, but can be changed from the code.

still looking at the best ways to fix other items.
Comment 4 David Williams CLA 2006-06-08 15:44:20 EDT
On behalf of Naci, I am doing a "bulk change" to this bug that showed "not fixed", but an "old" target milestone. 

If it anyone knows that this bug *was* in fact fixed, and the bug just not updated, please let us know. 
Comment 5 Wolfgang Knauf CLA 2006-06-20 10:45:15 EDT
I took a look at the wizard in 1.5RC5, and there seems to be a major problem with it: EJB project with JBoss 4 runtime and JDK 1.4, XDoclet 1.2.3 facet is actived. I try to add an entity bean and use the use case "Define new attributes". 
After clicking next the "CMP attributes" page comes up, but clicking on the "Add" button does not add a new table row, so that I cannot use the wizard in fact. 
There is an error message "Entity bean has no attributes" which is perfectly correct. 
No error in the log file.

For the other items in my initial post:
Fixed are a, b, c, d. The rest I could not verify because I could not finish the wizard.
Comment 6 Wolfgang Knauf CLA 2006-06-21 03:24:36 EDT
Filed the broken attributes wizard page in #147991 (I hope this creates a bug link...) because it seems too major to me. 
 
Comment 7 Naci Dai CLA 2006-06-21 05:20:54 EDT
Wolfgang thanks for catching this.

bug: 147991 This is a regression bug the use caes for "define new attributes" fails because the model getProperty returns default property for attributes, but does not set it so attributes are lost as they are added.

the patch is attached.  Changes are localized, tested and safe.  I vote +1 for 1.5

Other changes (items e & g)  to improve the usability of the CMP wizard will be scheduled for 1.5.1 (i.e. add dimensions for VARCHARs etc.)  Currently these can be edited in the source annotations.
Comment 8 Wolfgang Knauf CLA 2006-06-26 05:35:40 EDT
The use case "Define new attributes" works fine in RC6. Thanks for fixing it.

I noticed something new: Two XDoclet tags are created for each field: "@ejb.persistent-field" and 
"@ejb.persistence". According to the doc for 1.2.3 "@ejb.persistent-field" is deprecated, and in the 1.2.0 docs either. So no XDoclet version supported by WTP requires it.
Comment 9 Naci Dai CLA 2006-08-29 09:15:20 EDT
- Added size/digits params to wizards.  (1.5.1 v2.0)
- I will keep the persistence field for now  (not sure how it will effect some of the xdoclet libraries that rae naintained with servers i.e. jonas maintains its won impl).

Closing this bug.  
Comment 10 Wolfgang Knauf CLA 2006-09-07 16:00:18 EDT
Thanks for all those improvements and for actually applying some of my suggestions !

Sorry to reopen it, but I came across a trapdoor which can be fixed easily (I think at least):

For a varchar column the default length is 0. If this is not changed this is generated: 
@ejb.persistence sql-type="VARCHAR(0)"

Wouldn't it make more sense to create a field with unspecified length ? A database field with length 0 is a true error ;-).
@ejb.persistence sql-type="VARCHAR" 

=====================

For "@ejb.persistent-field" question: why not putting a checkbox somewhere in the wizard "create (deprecated) @ejb.persistent-field" tags ? I think 99% of the users will not need the old stuff, but get some more lines of comments.

=====================
Would it be possible to create a default value for the "Table" field in the use case "Define new attributes" (wizard page "CMP attributes") ?

====================
Still open: f) from my original post (synchronize Type/SQL Type/JDBC Type). 

Tell me at least that it is not planned to fix all these, then I will close the bug ;-).
Comment 11 Wolfgang Knauf CLA 2006-09-07 16:28:53 EDT
Oops, I see that "SQL Type" and "JDBC Type" ARE synchronized. So this is 50% done, now it would be great to switch the "SQL Type" to "INT" if "Type" is e.g. "java.lang.Integer". 

Could the "Column name" be defaulted with the upper case "Attribute name" after jumping from "attribute name" to "column name" ?

And one (really) last point: could you please make the combox for the sql types larger so that it shows more than 5 items are not much.
Comment 12 Kaloyan Raev CLA 2008-04-09 03:22:22 EDT
Mass reassignment of bugs from Naci to ejb-inbox. 
Comment 13 Kaloyan Raev CLA 2012-11-02 03:41:13 EDT
I am closing all tickets related to XDoclet as WON'T FIX, because there is no committer to support this functionality. I can review patches if anyone is willing to contribute.
Comment 14 Wolfgang Knauf CLA 2012-11-26 11:42:13 EST
Closing, XDoclet has not much relevance...