View Javadoc
1   package info.ejava.examples.ejb.tx.bo;
2   
3   import javax.persistence.Column;
4   import javax.persistence.Entity;
5   import javax.persistence.Id;
6   import javax.persistence.Table;
7   
8   @Entity
9   @Table(name="EJBTX_BEANCOUNT")
10  public class BeanCount {
11      @Id 
12      @Column(name="BEAN_NAME", length=32)
13      String name;
14      
15      @Column(name="COUNT")
16      int count;
17      
18      protected BeanCount() {}
19      public BeanCount(String beanName) {
20          this.name = beanName;
21      }
22      public String getName() { return name; }
23      
24      public int getCount() { return count; }
25      public void setCount(int count) {
26          this.count = count;
27      }
28      
29      @Override
30      public String toString() {
31          StringBuilder builder = new StringBuilder();
32          builder.append("BeanCount [name=").append(name)
33                  .append(", count=").append(count).append("]");
34          return builder.toString();
35      }
36  }