public class Fixtures extends Object
Modifier and Type | Field and Description |
---|---|
static Map<String,Object> |
idCache |
static 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(Class<? extends Model>... types)
Delete all Model instances for the given types using the underlying persistence mechanisms
|
static void |
delete(List<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(String path)
Delete a directory recursively
|
static void |
executeSQL(File sqlScript) |
static void |
executeSQL(String sqlScript) |
static void |
load(List<String> names)
Deprecated.
use
loadModels(String...) instead |
static void |
load(String... names)
Deprecated.
use
loadModels(String...) instead |
static void |
load(String name)
Deprecated.
use
loadModels(String...) instead |
static void |
loadModels(boolean loadAsTemplate,
List<String> names) |
static void |
loadModels(boolean loadAsTemplate,
String... names) |
static void |
loadModels(boolean loadAsTemplate,
String name)
Load Model instances from a YAML file and persist them using the underlying persistence mechanism.
|
static void |
loadModels(List<String> names) |
static void |
loadModels(String... names) |
static void |
loadModels(String name)
Load Model instances from a YAML file and persist them using the underlying persistence mechanism.
|
static Object |
loadYaml(String name)
Load and parse a plain YAML file and returns the corresponding Java objects.
|
static <T> T |
loadYaml(String name,
Class<T> clazz)
Load and parse a plain YAML file and returns the corresponding Java Map.
|
static <T> T |
loadYaml(String name,
org.yaml.snakeyaml.Yaml yaml) |
static List<?> |
loadYamlAsList(String name)
Load and parse a plain YAML file and returns the corresponding Java List.
|
static Map<?,?> |
loadYamlAsMap(String name)
Load and parse a plain YAML file and returns the corresponding Java Map.
|
public static final String PROFILE_NAME
public static void executeSQL(String sqlScript)
public static void executeSQL(File sqlScript)
public static void delete(Class<? extends Model>... types)
types
- Types to deletepublic static void delete(List<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(String name)
loadModels(String...)
insteadname
- public static void loadModels(String name)
name
- Name of a YAML file somewhere in the classpath (or conf/)public static void loadModels(boolean loadAsTemplate, 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(String... names)
loadModels(String...)
insteadpublic static void loadModels(String... names)
loadModels(String name)
public static void loadModels(boolean loadAsTemplate, String... names)
@Deprecated public static void load(List<String> names)
loadModels(String...)
insteadpublic static void loadModels(List<String> names)
loadModels(String name)
public static void loadModels(boolean loadAsTemplate, List<String> names)
loadModels(boolean, String...)
public static Object loadYaml(String name)
name
- Name of a YAML file somewhere in the classpath (or conf/)mepublic static List<?> loadYamlAsList(String name)
name
- Name of a YAML file somewhere in the classpath (or conf/)mepublic static Map<?,?> loadYamlAsMap(String name)
name
- Name of a YAML file somewhere in the classpath (or conf/)mepublic static <T> T loadYaml(String name, Class<T> clazz)
name
- Name of a YAML file somewhere in the classpath (or conf/)meclazz
- the expected classpublic static <T> T loadYaml(String name, org.yaml.snakeyaml.Yaml yaml)
public static void deleteDirectory(String path)
path
- relative path of the directory to deleteGuillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly