The next step after mapping is to generate the CRUD. So for that you will have to select the CRUD tab.
CRUDs generation is one of the main features of the project. CRUD helps you to select the controls for the various attributes of the table according to the needs of the developer. You can set your CRUDs visually through a simple and intuitive interface as we can see the image below.
There are few simple steps for creating CRUD. We would consider the 'guide' project example. Immediately after clicking on the CRUD tab you would find your 'Team' class in the CRUD attribute under 'Only ejb3@Entity' section. For example consider 'Team' as the class.
Choose CRUD class: Select the 'Team' class. After selecting the team class you would find all the available attributes towards the right hand side of the menu in the 'choose attribute' section.
Choose attributes of CRUD: Now one by one only select those attributes which are necessary for the development of the web project. You will find that the attributes are getting added to the table down below in the rules section. You can also discard the unwanted attributes by again clicking on the selected attribute in the choose attribute section. The rules table would give you the detailed implementation description of the attributes used by the java bean class.
HTML Types: After selecting all the attributes necessary you can change the control of the attribute according to the needs of the developer.
Primary Key: Any attribute which is primary you should select the radio button corresponding to it under 'Key'.
Validation: You can also define the validation rules for the particular attribute by clicking on the validation column. If you click on it you would find a small button on the right hand side. Click on that button and a CRUD validator menu would appear where you can set your validation rule. If you want to set required condition for a particular attribute you can check the required check box corresponding to that attribute. Please look at the below screen shot for setting up the validations
This is a validation of screen interface for frameworks that have validations in beans as Hibernate Validator and OVal.
The idea is simple: you can choose one or more validations to add in their field and edit the properties of this validation.
Layout: Also you can select the type of layout by clicking the layout button. Here the developer can choose layout for the various fields according to the requirement of the developer. Please look at the below screen shot for setting up the Layout
Module: Before building the CRUD make sure that you select the particular module where you want to build the CURD. This can be done by selecting the particular module from the drop down menu which is situated at the right side end of the editor.
Build CRUD: Now after every thing gets done we would select the 'build this CURD' button for building the CURD. If we have more than one CRUD to build then we can select 'build all CURD' for building CURD for all the available classes.
Ant Build: After you have build your CRUD the work of the spider editor gets over here. So close the Spider editor after you are done.
Before actually running your project on tomcat server make sure that you have build your Ant.
So for building the ant you first have to select the ant tool. For that you will have to click on window / show view / others from the menu bar above. A menu would pop up. From that menu select ant tool from the ant folder. You would notice an additional 'Ant tab' which gets added automatically.
Now from the project explorer for the 'guide' project look for 'xdoclet-build' file. Drag that file to the Ant build tab. The file would be added to the ant tab automatically. Now right click on the 'xDoclet guide' file a menu would appear select Run as / Ant Build. Now the project 'guide' has been built completely.




