We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e916495 commit b527ee2Copy full SHA for b527ee2
1 file changed
src/test/java/org/javawebstack/orm/test/shared/setup/ModelSetup.java
@@ -0,0 +1,22 @@
1
+package org.javawebstack.orm.test.shared.setup;
2
+
3
+import org.javawebstack.orm.Model;
4
+import org.javawebstack.orm.ORM;
5
+import org.javawebstack.orm.Repo;
6
+import org.javawebstack.orm.exception.ORMConfigurationException;
7
+import org.javawebstack.orm.test.shared.settings.MySQLConnectionContainer;
8
9
+public class ModelSetup extends MySQLConnectionContainer {
10
11
+ public static <T extends Model> Repo<T> setUpModel(Class<T> clazz) {
12
13
+ // Converting to Runtime exception to avoid having to declare the thrown error which has no utility
14
+ try {
15
+ ORM.register(clazz, sql());
16
+ } catch (ORMConfigurationException e) {
17
+ throw new RuntimeException(e);
18
+ }
19
20
+ return Repo.get(clazz);
21
22
+}
0 commit comments