-
- All Known Implementing Classes:
DefaultDomain
,TestDomain
public interface Domain
Represents an application domain model, entities, reports and database operations.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
configureConnection(DatabaseConnection connection)
Configures a database connection for applications using this domain model, for example adding extensions or properties.static List<Domain>
domains()
Entities
entities()
<C,T,R>
DatabaseFunction<C,T,R>function(FunctionType<C,T,R> functionType)
Retrieves the function of the given type.Map<FunctionType<?,?,?>,DatabaseFunction<?,?,?>>
functions()
static Optional<Domain>
instanceByClassName(String className)
static Optional<Domain>
instanceByName(String name)
<C,T>
DatabaseProcedure<C,T>procedure(ProcedureType<C,T> procedureType)
Retrieves the procedure of the given type.Map<ProcedureType<?,?>,DatabaseProcedure<?,?>>
procedures()
<T,R,P>
Report<T,R,P>report(ReportType<T,R,P> reportType)
Retrieves the report of the given type.Map<ReportType<?,?,?>,Report<?,?,?>>
reports()
DomainType
type()
-
-
-
Method Detail
-
type
DomainType type()
- Returns:
- the domain type
-
entities
Entities entities()
- Returns:
- the Domain entities
-
reports
Map<ReportType<?,?,?>,Report<?,?,?>> reports()
- Returns:
- an unmodifiable view of this domain's reports
-
procedures
Map<ProcedureType<?,?>,DatabaseProcedure<?,?>> procedures()
- Returns:
- an unmodifiable view of this domain's procedures
-
functions
Map<FunctionType<?,?,?>,DatabaseFunction<?,?,?>> functions()
- Returns:
- an unmodifiable view of this domain's functions
-
report
<T,R,P> Report<T,R,P> report(ReportType<T,R,P> reportType)
Retrieves the report of the given type.- Type Parameters:
T
- the report typeR
- the report result typeP
- the report parameters type- Parameters:
reportType
- the report type- Returns:
- the report
- Throws:
IllegalArgumentException
- in case the report is not found
-
procedure
<C,T> DatabaseProcedure<C,T> procedure(ProcedureType<C,T> procedureType)
Retrieves the procedure of the given type.- Type Parameters:
C
- the type of the database connection this procedure requiresT
- the argument type- Parameters:
procedureType
- the procedure type- Returns:
- the procedure
- Throws:
IllegalArgumentException
- in case the procedure is not found
-
function
<C,T,R> DatabaseFunction<C,T,R> function(FunctionType<C,T,R> functionType)
Retrieves the function of the given type.- Type Parameters:
C
- the type of the database connection this function requiresT
- the argument typeR
- the result type- Parameters:
functionType
- the function type- Returns:
- the function
- Throws:
IllegalArgumentException
- in case the function is not found
-
configureConnection
default void configureConnection(DatabaseConnection connection) throws DatabaseException
Configures a database connection for applications using this domain model, for example adding extensions or properties.- Parameters:
connection
- the connection to configure- Throws:
DatabaseException
- in case of an exception
-
domains
static List<Domain> domains()
- Returns:
- a list containing all the Domains registered with
ServiceLoader
.
-
instanceByName
static Optional<Domain> instanceByName(String name)
- Parameters:
name
- the domain name- Returns:
- a
Domain
implementation with the given name, if found - See Also:
DomainType.name()
-
instanceByClassName
static Optional<Domain> instanceByClassName(String className)
- Parameters:
className
- the domain classname- Returns:
- a
Domain
implementation of the given type, if found - See Also:
DomainType.name()
-
-