File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/test/java/org/javawebstack/orm/test/shared/setup Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments