idgenerator.java

来自「软件设计课做的一个类似Hibernate的O/R Mapping的框架」· Java 代码 · 共 28 行

JAVA
28
字号
package cn.edu.nju.software.sd.torm.util;

import java.sql.Connection;

import cn.edu.nju.software.sd.torm.PersistenceException;

/**
 * The IDGenerator is a interface. It has only one method nextID to
 * generate the next unique id for the object. The IDGenerator can be
 * specified by the user in configure file.
 * 
 * @author YinfeiXU
 *
 */
public interface IDGenerator {
	
	/**
	 * Generate the next unique id for the object.
	 * 
	 * @param con The database connection.
	 * @param tableName The name of the target table. 
	 * @param columnName The name of the target column.
	 * @return The next unique id.
	 * @throws PersistenceException
	 */
	public int nextID(Connection con, String tableName, String columnName)throws PersistenceException;
}

⌨️ 快捷键说明

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