swapbean.java

来自「RESIN 3.2 最新源码」· Java 代码 · 共 34 行

JAVA
34
字号
package example;import javax.ejb.Stateless;import javax.ejb.TransactionAttribute;import static javax.ejb.TransactionAttributeType.REQUIRED;import static javax.ejb.TransactionAttributeType.SUPPORTS;/** * Implementation of the Swap bean. */@Stateless(name="swap")public class SwapBean implements Swap {  /**   * Swaps the teacher inside a transaction.   */  @TransactionAttribute(REQUIRED)  public void swap(Course a, Course b)  {    String teacher = a.getTeacher();    a.setTeacher(b.getTeacher());    b.setTeacher(teacher);  }    /**   * Returns the teacher.   */  @TransactionAttribute(SUPPORTS)  public String getTeacher(Course a)  {    return a.getTeacher();  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?