package org.bdgp.MMSlide.DB;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable
public class Pool {
    @DatabaseField(generatedId=true, canBeNull=false)
    private int id;

    public Pool() { }
    public Pool(int id) { 
        this.id = id;
    }
    public int getId() { return this.id; }
    public String getName() { return String.format("P%05d", this.id); }
}

@@ -23,16 +23,81 @@
 de.DB;%0A%0A
+import java.util.regex.Matcher;%0Aimport java.util.regex.Pattern;%0A%0A
 import c
@@ -480,11 +480,281 @@
 s.id); %7D
+%0A%0A%09public static Integer name2id(String poolName) %7B%0A        Pattern pattern = Pattern.compile(%22%5EP(%5B0-9%5D+)$%22);%0A        Matcher matcher = pattern.matcher(poolName);%0A        if (matcher.find()) %7B%0A            return new Integer(matcher.group(1));%0A        %7D%0A%09%09return null;%0A%09%7D
 %0A%7D%0A

add function to convert from pool name to ID