📄 swapbean.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -