1 package org.objectweb.jonas.jtests.beans.relation.tier; 2 3 import javax.ejb.*; 4 5 10 public abstract class SequenceBean implements EntityBean { 11 12 15 public String ejbCreate(String name) throws javax.ejb.CreateException { 16 setName(name); 17 setIndex(0); 18 return null; 19 } 20 21 public void ejbPostCreate(String name) throws javax.ejb.CreateException { 22 } 23 24 28 public abstract int getIndex(); 29 public abstract void setIndex(int newIndex); 30 31 35 public abstract String getName(); 36 public abstract void setName(java.lang.String newName); 37 38 public int getValueAfterIncrementingBy(int blockSize) { 39 setIndex(getIndex() + blockSize); 40 return getIndex(); 41 } 42 } 43 | Popular Tags |