cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ugo Cei <>
Subject Re: SQL Editor
Date Tue, 04 Feb 2003 14:39:38 GMT
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) { = id; }
   public String getName() { return name; }
   public void setName(String 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(); = 'Acme Inc.';
   log.debug("Customer name = " +;

- easily bind it to a form:

   var form = new Form(formId, cust);

- easily refer to its attributes, using XPath syntax, in the form 

   <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 Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail:

To unsubscribe, e-mail:
For additional commands, email:

View raw message