cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <agalla...@agsoftware.dnsalias.com>
Subject Re: SQL Editor
Date Tue, 04 Feb 2003 15:39:45 GMT
hi:

As you suggested, then I think there is not need to go to deeply to UML.
Sometimes I get too deeply in things. :-(

What I was trying to find is a way to easy mantain the EJB. Druid
(http://druid.sourceforge.net/) can can generate the following code based
on a SQL model:

//==============================================================================
//===   CanjeEstado.java                        Build:174
//==============================================================================

package my.package.myapplication;

import java.util.*;

//==============================================================================

public class ags_CanjeEstado
{
   public static final String CAN_ID            = "can_id";
   public static final String TEC_ID            = "tec_id";
   public static final String USR_ID            = "usr_id";
   public static final String CES_TIEMPO        = "ces_tiempo";
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
   private int        can_id;
   private int        tec_id;
   private int        usr_id;
   private timestamp  ces_tiempo;
//---------------------------------------------------------------------------
   public int getCan_id() { return can_id; }

   public void setCan_id(int can_id)
   {
      checkDirty(this.can_id, can_id);
      this.can_id = can_id;
   }
//---------------------------------------------------------------------------
   public int getTec_id() { return tec_id; }

   public void setTec_id(int tec_id)
   {
      checkDirty(this.tec_id, tec_id);
      this.tec_id = tec_id;
   }
//---------------------------------------------------------------------------
   public int getUsr_id() { return usr_id; }

   public void setUsr_id(int usr_id)
   {
      checkDirty(this.usr_id, usr_id);
      this.usr_id = usr_id;
   }
//---------------------------------------------------------------------------
   public timestamp getCes_tiempo() { return ces_tiempo; }

   public void setCes_tiempo(timestamp ces_tiempo)
   {
      checkDirty(this.ces_tiempo, ces_tiempo);
      this.ces_tiempo = ces_tiempo;
   }
}
//==============================================================================

As I wrote before, this class is based on a SQL table. There is no attach
to a form. Of course some forms can use more tables simultaneously. There
is the gap I saw with Druid.

>From your meail I got that Beans are form based, not Database based.

Then I need to find other tool that can create the Beans and easily
mantain it. You suggested Hibernate. Can you provide a website when I can
learn more about Hibernate?

Best Regards,

Antonio Gallardo



Ugo Cei dijo:
> Antonio Gallardo wrote:
>
>> Master,
>
> Disciple, ;-)
>
>> Can you show us the light? As I posted before I never used beans. But
>> after seeing some comments here. I feel as something is missing to me.
>> I want to do Java Beans. I use jEdit to work. :-)
>
> I suspect that you might be confusing plain Java Beans and Enterprise
> Java Beans (EJBs).
>
> I'm talking about the former here. This is a bean:
>
> public class Customer {
>    private Long id;
>    private String name;
>    private Address address;
>
>    public Long getId() { return id; }
>    public void setId(Long id) { this.id = id; }
>    public String getName() { return name; }
>    public void setName(String name) { this.name = name; }
>    public Address getAddress() { return address; }
>    public void setAddress(Address address) { this.address = address; }
> }
>
> If you have this kind of object, you can:
>
> - easily persist it via Hibernate (or any other O/R mapping tool) to one
>  or more relational tables
>
> - easily access its attributes from the flow:
>
>    var cust = new Customer();
>    cust.name = 'Acme Inc.';
>    log.debug("Customer name = " + cust.name);
>
> - easily bind it to a form:
>
>    var form = new Form(formId, cust);
>
> - easily refer to its attributes, using XPath syntax, in the form
> descriptor:
>
>    <xf:textbox ref="/name">
>
> - easily retrieve its attributes in the view (XSP) using XPath syntax:
>
>    <jpath:value-of select="cust/name"/>
>
>>>If I were lazier, I'd  even use XDoclet to generate the Hibernate
>>> mapping files from javadoc comments in the source.
>>
>>
>> This is interesting too. How it works?
>
> Using Hibernate, you have to declare how your objects map to relational
> tables in a "mapping document" (XML file). With XDoclet, you get to
> automatically generate your mapping files from Javadoc-like comments in
> the source. I haven't uesd it yet, so I cannot tell you more about this.
>
> 	Ugo
>
> --
> Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
> P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
> Phone: +39.0382.525100 - E-mail: u.cei@cbim.it
>
>
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message