Skip to content

Commit e9647d6

Browse files
committed
Added deprecated legacy register methods
1 parent 085b293 commit e9647d6

File tree

1 file changed

+22
-0
lines changed
  • src/main/java/org/javawebstack/orm

1 file changed

+22
-0
lines changed

src/main/java/org/javawebstack/orm/ORM.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package org.javawebstack.orm;
22

3+
import org.javawebstack.orm.connection.SQL;
34
import org.javawebstack.orm.connection.pool.SQLPool;
5+
import org.javawebstack.orm.connection.pool.SingletonPool;
46
import org.javawebstack.orm.exception.ORMConfigurationException;
57
import org.javawebstack.orm.migration.AutoMigrator;
68
import org.reflections.Reflections;
@@ -40,6 +42,26 @@ public static void register(Package p, SQLPool pool) throws ORMConfigurationExce
4042
register(p, pool, new ORMConfig());
4143
}
4244

45+
@Deprecated
46+
public static <T extends Model> Repo<T> register(Class<T> model, SQL sql, ORMConfig config) throws ORMConfigurationException {
47+
return register(model, new SingletonPool(sql), config);
48+
}
49+
50+
@Deprecated
51+
public static <T extends Model> Repo<T> register(Class<T> model, SQL sql) throws ORMConfigurationException {
52+
return register(model, new SingletonPool(sql));
53+
}
54+
55+
@Deprecated
56+
public static void register(Package p, SQL sql, ORMConfig config) throws ORMConfigurationException {
57+
register(p, new SingletonPool(sql), config);
58+
}
59+
60+
@Deprecated
61+
public static void register(Package p, SQL sql) throws ORMConfigurationException {
62+
register(p, new SingletonPool(sql));
63+
}
64+
4365
public static void unregister(Class<? extends Model> model) {
4466
repositories.remove(model);
4567
}

0 commit comments

Comments
 (0)