The Customer bean encapsulates the name of the customer in the Name value object.
The Name value object must be tagged with the @Embeddable annotation.
@Embeddable
public class Name implements java.io.Serializable
{
}}
The properties of Name must then be mapped to columns within Customer's table.
@Embedded
@AttributeOverrides({
@AttributeOverride(name = "first", column = {@Column(name = "FIRST_NAME")}),
@AttributeOverride(name = "last", column = {@Column(name = "LAST_NAME")})
})
public Name getName()
{
return name;
}
Unix: $ export JBOSS_HOME=<where your jboss 4.0 distribution is>
Windows: $ set JBOSS_HOME=<where your jboss 4.0 distribution is>
$ ant
$ ant run
run:
[java] Create Bill Burke and Monica Smith
[java] 2004-10-06 22:27:50,344 INFO org.jboss.remoting.InvokerRegistry[main] - Failed to load soap remoting transpo
rt: org/apache/axis/AxisFault
[java] Bill and Monica get married
[java] Get all the Burkes
[java] There are now 2 Burkes
The INFO message you can ignore. It will be fixed in later releases of JBoss 4.0.