View Javadoc
1   package ejava.examples.ejbwar.customer.bo;
2   
3   import java.io.Serializable;
4   
5   import javax.persistence.Column;
6   import javax.persistence.MappedSuperclass;
7   import javax.persistence.Version;
8   import javax.xml.bind.annotation.XmlAttribute;
9   
10  /**
11   * This class provides base definition and helper methods for representations
12   * within the customer domain.
13   */
14  @SuppressWarnings("serial")
15  @MappedSuperclass
16  public abstract class CustomerRepresentation implements Serializable {
17  	public static final String NAMESPACE = "http://webejb.ejava.info/customer";
18  	
19  	@Version
20  	@Column(name="VERSION")
21  	private int version;
22  	
23  	/**
24  	 * This property is added to each entity so that we can have better 
25  	 * control over concurrent updates
26  	 * @return
27  	 */
28  	@XmlAttribute(required=true)
29  	public int getVersion() { return version; }
30  	public void setVersion(int version) {
31  		this.version = version;
32  	}
33  }