Search in sources :

Example 1 with MapperKey

use of org.simpleflatmapper.map.mapper.MapperKey in project SimpleFlatMapper by arnaudroger.

the class Utils method generateKeys.

public static List<MapperKey<JdbcColumnKey>> generateKeys(int size, int maxColumns) {
    Random random = new Random(13265656556l);
    ArrayList<MapperKey<JdbcColumnKey>> list = new ArrayList<>(size);
    for (int i = 0; i < size; i++) {
        int nbColumn = random.nextInt(maxColumns) + 2;
        JdbcColumnKey[] columnKeys = new JdbcColumnKey[nbColumn];
        for (int j = 0; j < columnKeys.length; j++) {
            JdbcColumnKey key = new JdbcColumnKey(newName(random), j + 1);
            columnKeys[j] = key;
        }
        list.add(new MapperKey<>(columnKeys));
    }
    return list;
}
Also used : JdbcColumnKey(org.simpleflatmapper.jdbc.JdbcColumnKey) Random(java.util.Random) ArrayList(java.util.ArrayList) MapperKey(org.simpleflatmapper.map.mapper.MapperKey)

Aggregations

ArrayList (java.util.ArrayList)1 Random (java.util.Random)1 JdbcColumnKey (org.simpleflatmapper.jdbc.JdbcColumnKey)1 MapperKey (org.simpleflatmapper.map.mapper.MapperKey)1