- All Known Implementing Classes:
DomainModel,SchemaDomain,TestDomain
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidConfigures a database, for example run migration scripts.default voidconfigure(Connection connection) Configures a database connection for applications using this domain model, for example adding extensions or properties.domains()entities()<C,P, R> DatabaseFunction <C, P, R> function(FunctionType<C, P, R> functionType) Retrieves the function of the given type.Map<FunctionType<?, ?, ?>, DatabaseFunction<?, ?, ?>> <C,P> DatabaseProcedure <C, P> procedure(ProcedureType<C, P> procedureType) Retrieves the procedure of the given type.Map<ProcedureType<?, ?>, DatabaseProcedure<?, ?>> <P,R> Report <?, P, R> report(ReportType<P, R> reportType) Retrieves the report of the given type.Map<ReportType<?, ?>, Report<?, ?, ?>> reports()type()
-
Method Details
-
type
DomainType type()- Returns:
- the domain type identifying this domain model
-
entities
Entities entities()- Returns:
- the Domain entities
-
reports
Map<ReportType<?,?>, reports()Report<?, ?, ?>> - Returns:
- an unmodifiable view of this domain's reports
-
procedures
Map<ProcedureType<?,?>, procedures()DatabaseProcedure<?, ?>> - Returns:
- an unmodifiable view of this domain's procedures
-
functions
Map<FunctionType<?,?, functions()?>, DatabaseFunction<?, ?, ?>> - Returns:
- an unmodifiable view of this domain's functions
-
report
Retrieves the report of the given type.- Type Parameters:
P- the report parameters typeR- the report result type- Parameters:
reportType- the report type- Returns:
- the report
- Throws:
IllegalArgumentException- in case the report is not found
-
procedure
Retrieves the procedure of the given type.- Type Parameters:
C- the type of the database connection this procedure requiresP- the parameter type- Parameters:
procedureType- the procedure type- Returns:
- the procedure
- Throws:
IllegalArgumentException- in case the procedure is not found
-
function
Retrieves the function of the given type.- Type Parameters:
C- the type of the database connection this function requiresP- the parameter typeR- the result type- Parameters:
functionType- the function type- Returns:
- the function
- Throws:
IllegalArgumentException- in case the function is not found
-
configure
Configures a database connection for applications using this domain model, for example adding extensions or properties. Called each time a new connection based on this domain is created.- Parameters:
connection- the connection to configure- Throws:
DatabaseException- in case of an exception
-
configure
Configures a database, for example run migration scripts. Only called once per database instance.- Parameters:
database- the database- Throws:
DatabaseException- in case of an exception
-
domains
Returns oneDomainperDomainTyperegistered withServiceLoader.Among multiple implementations of one domain type the most derived one wins: the unique implementation class every other implementation class is assignable from, a variant extending the base such as one adding engine backed reports. Identical implementations, a jar present twice, resolve to either instance. Unrelated implementations of one type, or two independent extensions of a common base, are genuine ambiguity the framework can not resolve and throw an
IllegalStateException; provide a single implementation extending the others, or remove all but one from the classpath. The result is deterministic, independent ofServiceLoaderiteration order.A consumer wanting the raw, possibly duplicate bearing list uses
ServiceLoader.load(Class)directly.- Returns:
- one
Domainper registeredDomainType - Throws:
IllegalStateException- in case a domain type has multiple unrelated implementations on the classpath
-