public class Fixtures
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.util.Map<java.lang.String,java.lang.Object> |
idCache |
static java.lang.String |
PROFILE_NAME
Name of the profile use when loading fixture Allow to define the behavior when loading fixtures
|
| Constructor and Description |
|---|
Fixtures() |
| Modifier and Type | Method and Description |
|---|---|
static void |
delete(java.lang.Class<? extends Model>... types)
Delete all Model instances for the given types using the underlying persistence mechanisms
|
static void |
delete(java.util.List<java.lang.Class<? extends Model>> classes)
Delete all Model instances for the given types using the underlying persistence mechanisms
|
static void |
deleteAll()
Deprecated.
use
deleteDatabase() instead |
static void |
deleteAllModels()
Delete all Model instances for the all available types using the underlying persistence mechanisms
|
static void |
deleteDatabase()
Flush the entire JDBC database
|
static void |
deleteDirectory(java.lang.String path)
Delete a directory recursively
|
static void |
executeSQL(java.io.File sqlScript) |
static void |
executeSQL(java.lang.String sqlScript) |
static void |
load(java.util.List<java.lang.String> names)
Deprecated.
use
loadModels(String...) instead |
static void |
load(java.lang.String... names)
Deprecated.
use
loadModels(String...) instead |
static void |
load(java.lang.String name)
Deprecated.
use
loadModels(String...) instead |
static void |
loadModels(boolean loadAsTemplate,
java.util.List<java.lang.String> names)
Load Model instances from multiple YAML files (compile first as a template) and persist them using the underlying
persistence mechanism.
|
static void |
loadModels(boolean loadAsTemplate,
java.lang.String... names)
Load Model instances from multiple YAML files (compile first as a template) and persist them using the underlying
persistence mechanism.
|
static void |
loadModels(boolean loadAsTemplate,
java.lang.String name)
Load Model instances from a YAML file and persist them using the underlying persistence mechanism.
|
static void |
loadModels(java.util.List<java.lang.String> names)
Load Model instances from multiple YAML files (compile first as a template) and persist them using the underlying
persistence mechanism.
|
static void |
loadModels(java.lang.String... names)
Load Model instances from multiple YAML files and persist them using the underlying persistence mechanism.
|
static void |
loadModels(java.lang.String name)
Load Model instances from a YAML file and persist them using the underlying persistence mechanism.
|
static java.lang.Object |
loadYaml(java.lang.String name)
Load and parse a plain YAML file and returns the corresponding Java objects.
|
static <T> T |
loadYaml(java.lang.String name,
java.lang.Class<T> clazz)
Load and parse a plain YAML file and returns the corresponding Java Map.
|
static <T> T |
loadYaml(java.lang.String name,
org.yaml.snakeyaml.Yaml yaml) |
static java.util.List<?> |
loadYamlAsList(java.lang.String name)
Load and parse a plain YAML file and returns the corresponding Java List.
|
static java.util.Map<?,?> |
loadYamlAsMap(java.lang.String name)
Load and parse a plain YAML file and returns the corresponding Java Map.
|
public static final java.lang.String PROFILE_NAME
public static java.util.Map<java.lang.String,java.lang.Object> idCache
public static void executeSQL(java.lang.String sqlScript)
public static void executeSQL(java.io.File sqlScript)
public static void delete(java.lang.Class<? extends Model>... types)
types - Types to deletepublic static void delete(java.util.List<java.lang.Class<? extends Model>> classes)
classes - Types to deletepublic static void deleteAllModels()
@Deprecated public static void deleteAll()
deleteDatabase() insteadpublic static void deleteDatabase()
@Deprecated public static void load(java.lang.String name)
loadModels(String...) insteadname - Name of a YAML file somewhere in the classpath (or conf/)public static void loadModels(java.lang.String name)
name - Name of a YAML file somewhere in the classpath (or conf/)public static void loadModels(boolean loadAsTemplate,
java.lang.String name)
name - Name of a YAML file somewhere in the classpath (or conf/)loadAsTemplate - indicate if the file must interpreted as a Template@Deprecated public static void load(java.lang.String... names)
loadModels(String...) insteadnames - Name of a YAML files somewhere in the classpath (or conf/)public static void loadModels(java.lang.String... names)
names - Name of a YAML files somewhere in the classpath (or conf/)loadModels(String name)public static void loadModels(boolean loadAsTemplate,
java.lang.String... names)
loadAsTemplate - Indicate if the YAML file should be compile first as a templatenames - Name of a YAML files somewhere in the classpath (or conf/)loadModels(boolean loadAsTemplate, String name)@Deprecated public static void load(java.util.List<java.lang.String> names)
loadModels(String...) insteadnames - Name of a YAML files somewhere in the classpath (or conf/)public static void loadModels(java.util.List<java.lang.String> names)
names - Name of a YAML files somewhere in the classpath (or conf/)loadModels(String name)public static void loadModels(boolean loadAsTemplate,
java.util.List<java.lang.String> names)
loadAsTemplate - Indicate if the YAML file should be compile first as a templatenames - Name of a YAML files somewhere in the classpath (or conf/)loadModels(boolean, String...)public static java.lang.Object loadYaml(java.lang.String name)
name - Name of a YAML file somewhere in the classpath (or conf/)mepublic static java.util.List<?> loadYamlAsList(java.lang.String name)
name - Name of a YAML file somewhere in the classpath (or conf/)mepublic static java.util.Map<?,?> loadYamlAsMap(java.lang.String name)
name - Name of a YAML file somewhere in the classpath (or conf/)mepublic static <T> T loadYaml(java.lang.String name,
java.lang.Class<T> clazz)
T - The entity loadname - Name of a YAML file somewhere in the classpath (or conf/)meclazz - the expected classpublic static <T> T loadYaml(java.lang.String name,
org.yaml.snakeyaml.Yaml yaml)
public static void deleteDirectory(java.lang.String path)
path - relative path of the directory to deleteGuillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly