Antonio Gallardo wrote:
Master,
Disciple, ;-)
I suspect that you might be confusing plain Java Beans and Enterprise Java Beans (EJBs).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'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"/>
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.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?
Ugo
--
Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]