Buggy code:
public class TableJDBCSeq extends AbstractJDBCSeq implements Configurable { public static final String ACTION_DROP = "drop" ; public static final String ACTION_ADD = "add" ; public static final String ACTION_GET = "get" ; public static final String ACTION_SET = "set" ; public static final String DEFAULT_TABLE = "OPENJPA_SEQUENCE_TABLE" ; private static final Localizer _loc = Localizer . forPackage ( TableJDBCSeq . class ) ; private transient JDBCConfiguration _conf = null ; private transient Log _log = null ; private int _alloc = 50 ; private int _intValue = 1 ; private final HashMap < ClassMapping , TableJDBCSeq . Status > _stat = new HashMap < ClassMapping , TableJDBCSeq . Status > ( ) ; private String _table = TableJDBCSeq . DEFAULT_TABLE ; private String _seqColumnName = "SEQUENCE_VALUE" ; private String _pkColumnName = "ID" ; private String [ ] _uniqueColumnNames ; private String _uniqueConstraintName ; private Column _seqColumn = null ; private Column _pkColumn = null ; public String getTable ( ) { } public void setTable ( String name ) { } public void setTableName ( String name ) { } public String getSequenceColumn ( ) { } public void setSequenceColumn ( String sequenceColumn ) { } public String getPrimaryKeyColumn ( ) { } public void setPrimaryKeyColumn ( String primaryKeyColumn ) { } public int getAllocate ( ) { } public void setAllocate ( int alloc ) { } public int getInitialValue ( ) { } public void setInitialValue ( int intValue ) { } public void setUniqueColumns ( String columnNames ) { } public String getUniqueColumns ( ) { } public void setIncrement ( int inc ) { } public JDBCConfiguration getConfiguration ( ) { } public void setConfiguration ( Configuration conf ) { } public void startConfiguration ( ) { } public void endConfiguration ( ) { } public void addSchema ( ClassMapping mapping , SchemaGroup group ) { Schema [ ] schemas = group . getSchemas ( ) ; for ( int i = 0 ; i < ( schemas . length ) ; i ++ ) { String schemaName = Strings . getPackageName ( _table ) ; if ( ( schemaName . length ( ) ) == 0 ) schemaName = Schemas . getNewTableSchema ( _conf ) ; if ( schemaName == null ) schemaName = schemas [ i ] . getName ( ) ; Schema schema = group . getSchema ( schemaName ) ; if ( schema == null ) schema = group . addSchema ( schemaName ) ; Table copy = schema . importTable ( _pkColumn . getTable ( ) ) ; Unique [ ] uniques = _pkColumn . getTable ( ) . getUniques ( ) ; for ( Unique u : uniques ) { <START_BUG> copy . importUnique ( u ) ; <END_BUG> } _pkColumn . resetTableName ( ( ( schemaName + "." ) + ( _pkColumn . getTableName ( ) ) ) ) ; _conf . getDBDictionaryInstance ( ) . createIndexIfNecessary ( schema , _table , _pkColumn ) ; } } protected Object nextInternal ( JDBCStore store , ClassMapping mapping ) throws Exception { } protected Object currentInternal ( JDBCStore store , ClassMapping mapping ) throws Exception { } protected void allocateInternal ( int count , JDBCStore store , ClassMapping mapping ) throws SQLException { } protected TableJDBCSeq . Status getStatus ( ClassMapping mapping ) { } protected Column addPrimaryKeyColumn ( Table table ) { } protected Object getPrimaryKey ( ClassMapping mapping ) { } private void buildTable ( ) { } private void allocateSequence ( JDBCStore store , ClassMapping mapping , TableJDBCSeq . Status stat , int alloc , boolean updateStatSeq ) throws SQLException { } private void insertSequence ( ClassMapping mapping , Connection conn ) throws SQLException { } protected long getSequence ( ClassMapping mapping , Connection conn ) throws SQLException { } protected boolean setSequence ( ClassMapping mapping , TableJDBCSeq . Status stat , int inc , boolean updateStatSeq , Connection conn ) throws SQLException { } public String resolveTableName ( ClassMapping mapping , Table table ) { } public void refreshTable ( ) throws SQLException { } public void dropTable ( ) throws SQLException { } public static void main ( String [ ] args ) throws Exception { } public static boolean run ( JDBCConfiguration conf , String [ ] args , Options opts ) throws Exception { } public static boolean run ( JDBCConfiguration conf , String [ ] args , String action ) throws Exception { } protected static class Status implements Serializable { public long seq = 1L ; public long max = 0L ; } protected PreparedStatement prepareStatement ( Connection conn , SQLBuffer buf ) throws SQLException { } protected int executeUpdate ( JDBCConfiguration conf , Connection conn , PreparedStatement stmnt , SQLBuffer buf , int opcode ) throws SQLException { } protected ResultSet executeQuery ( JDBCConfiguration conf , Connection conn , PreparedStatement stmnt , SQLBuffer buf ) throws SQLException { } protected long getSequence ( ResultSet rs , DBDictionary dict ) throws SQLException { } public void setUniqueConstraintName ( String _uniqueConstraintName ) { } public String getUniqueConstraintName ( ) { } protected class AllocateSequenceRunnable implements Runnable { JDBCStore store = null ; ClassMapping mapping = null ; TableJDBCSeq . Status stat = null ; int alloc ; boolean updateStatSeq ; AllocateSequenceRunnable ( JDBCStore store , ClassMapping mapping , TableJDBCSeq . Status stat , int alloc , boolean updateStatSeq ) { } public void run ( ) throws RuntimeException { } } protected class CurrentSequenceRunnable implements Runnable { private JDBCStore _store ; private ClassMapping _mapping ; CurrentSequenceRunnable ( JDBCStore store , ClassMapping mapping ) { } public void run ( ) throws RuntimeException { } } }

Fix:
copy . importUnique ( u , _conf . getDBDictionaryInstance ( ) ) ;