Wiki

Imprimir Propiedades
Roma_users_module_CRUD

Adding CRUD

 

Once we have defined the domain classes for the application we generate a CRUD for each class. From the Roma console type the following commands.

./roma.sh crud gesfor.roma.swrisks.domain.Attack

./roma.sh crud gesfor.roma.swrisks.domain.Company

./roma.sh crud gesfor.roma.swrisks.domain.Risk

 

Refreshing the project in Eclipse it can be seen that 3 new packages has been created under gesfor.roma.swrisks.view.domain. They provide classes to manage and show persistent data using a browser with create, update and delete operations. Now we need to tell Roma which classes will be treated as persistents. In the package gesfor.roma.swrisks.domain edit the file package.jdo as follow:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE jdo PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN" "jdo.dtd">

<jdo>

  <package name="gesfor.roma.swrisks.domain">

   <class name="Company" detachable="true" />

   <class name="Risk" detachable="true" />

   <class name="Attack" detachable="true" >

    <field name="attackType" default-fetch-group="true" />

    <field name="company" default-fetch-group="true" />

   </class>

  </package>

</jdo>

 

With the detachable attribute we indicate which classes must be stored in the database by the JPOX module.

Last Update: 2008-08-18

 

<< Prev Roma Users module Next>>
1837 Accesos, 0 Ficheros adjuntos 0 Ficheros adjuntos

  • Comentarios