
com.github.javaclub.jorm.id.AutoIdGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jorm Show documentation
Show all versions of jorm Show documentation
This is a java JDBC ORM Framework
/*
* @(#)AutoIdGenerator.java 2011-8-5
*
* Copyright (c) 2011. All Rights Reserved.
*
*/
package com.github.javaclub.jorm.id;
import java.io.Serializable;
import java.lang.reflect.Field;
import com.github.javaclub.jorm.Session;
import com.github.javaclub.jorm.jdbc.sql.Dialect;
/**
* AutoIdGenerator
*
* @author Gerald Chen
* @version $Id: AutoIdGenerator.java 2011-8-5 下午07:18:27 Exp $
*/
public class AutoIdGenerator implements IdentifierGenerator {
private Dialect dialect;
public AutoIdGenerator() {
super();
}
public Serializable generate(Session session, Object object, Field field) {
return IncreasableIdentifiers.getNextIdValue(session, object.getClass(), field);
}
public void setDialect(Dialect dialect) {
this.dialect = dialect;
}
public Dialect getDialect() {
return dialect;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy