阅读本文后: Send String second Argument IdentifierGenerator - Hibernate 我有一个问题如何将模式名称传递给IdGenerator? 是否可以访问hibernate的spring配置?
所以我可以读取模式名称并正确地形成这样的SQL查询:
final Connection connection = sessionImplementor.connection();
PreparedStatement preparedStatement;
try {
preparedStatement = connection.prepareStatement("SELECT * FROM "+shemaName+".cbr_seqnr WHERE seqnr_name =?");
preparedStatement.setString(1,seqName);
}