personfactory.java
来自「OR Mapping工具」· Java 代码 · 共 30 行
JAVA
30 行
package org.ephman.examples.family;import java.sql.*;import org.ephman.abra.database.*;import org.ephman.abra.utils.*;import org.ephman.examples.family.generated.*;public class PersonFactory extends AbstractPersonFactory { private static PersonFactory theInstance; public static synchronized PersonFactory getInstance () { if (theInstance == null) theInstance = new PersonFactory (); return theInstance; } /** this method describes what must be retrived for completeness*/ protected void deepRetrieval (DatabaseSession dbSess, Identified item) throws SQLException { Person p = (Person)item; p.setFather (getByOid (dbSess, p.getFatherOid ())); p.setMother (getByOid (dbSess, p.getMotherOid ())); } public Person getByAge (DatabaseSession dbSess, int age) throws SQLException { return (Person)super.getObject (dbSess, super.age, age); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?