Interface IPromptConnectionDao
public interface IPromptConnectionDao
Data access object for creating, updating, and deleting
PromptConnectionEntity entities.- Since:
- 8.5.0
- Author:
- XIMA MEDIA GmbH
-
Method Summary
Modifier and TypeMethodDescriptioncreateOrUpdate(PromptConnectionEntity entity) Creates the given prompt connection if it does not exist, or updates it if it does.voiddelete(PromptConnectionEntity existing) Deletes the given prompt connection.longdeleteAllByScope(String scopeKind, long scopeId) Deletes all prompt connections that belong to the specified scope.findUniqueName(String scopeKind, long scopeId, String candidateName, PromptConnectionEntity exclude) Finds a new unique name for a (new) given prompt connection.getAllByScope(String scopeKind, long scopeId) Gets all prompt connections that belong to the specified scope.getAllByScopeIncludeChildren(String scopeKind, long scopeId) Gets all prompt connections that belong to the specified scope, or a child scope of that scope.getAllByScopeIncludeParents(String scopeKind, long scopeId) Gets all prompt connections that belong to the specified scope, or a parent scope of that scope.getAllByType(String type) Finds all prompt connections of a given type from all scopes.getAllByType(String type, String scopeKind, long scopeId) Finds all prompt connections of a given type assigned to the specified scope.getAllByTypeIncludeChildren(String type, String scopeKind, long scopeId) Finds all prompt connections of a given type assigned to the specified scope or a child of that scope.getAllByTypeIncludeParents(String type, String scopeKind, long scopeId) Finds all prompt connections of a given type assigned to the specified scope or a parent of that scope.Gets a prompt connection with a given name that belongs to the specified scope.getByQuery(String scopeKind, long scopeId, UUID query) Gets the prompt connection that wasconfiguredfor the given query.Gets a prompt connection by its UUID with the specified scope.Gets thetypeof a prompt connection.
-
Method Details
-
createOrUpdate
Creates the given prompt connection if it does not exist, or updates it if it does.- Parameters:
entity- The prompt connection entity to create or update.- Returns:
- The created or updated prompt connection entity.
-
delete
Deletes the given prompt connection.- Parameters:
existing- The prompt connection to delete.
-
deleteAllByScope
Deletes all prompt connections that belong to the specified scope. This also deletes all connections from dependent scopes. E.g. deleting all tenant-scoped connections also deletes all project-scoped connections.Note: Normally you would want to call
queryDao.deleteAllByScope()first to delete all prompt queries of the scope, before deleting the connections.- Parameters:
scopeKind- The kind of the scope whose prompt connections are to be deleted.scopeId- The ID of the scope whose prompt connections are to be.- Returns:
- The number of deleted prompt connections.
-
findUniqueName
String findUniqueName(String scopeKind, long scopeId, String candidateName, PromptConnectionEntity exclude) Finds a new unique name for a (new) given prompt connection. The returned name is unique amongst all prompt queries of the given scope. The returned name is based on the given candidate name. If no connection with the candidate name exists, the candidate name is returned.- Parameters:
scopeKind- The kind of the scope for which to check name uniqueness.scopeId- The ID of the scope for which to check name uniqueness.candidateName- A candidate name to make unique.exclude- Optional. When given, the name of this prompt connection is excluded from the uniqueness check.- Returns:
- A unique name based on the candidate name.
-
getAllByScope
Gets all prompt connections that belong to the specified scope.- Parameters:
scopeKind- The kind of the scope for which to retrieve the prompt connections.scopeId- The ID of the scope for which to retrieve the prompt connections.- Returns:
- A list of all prompt connections associated with the specified scope.
-
getAllByScopeIncludeChildren
Gets all prompt connections that belong to the specified scope, or a child scope of that scope.- Parameters:
scopeKind- The kind of the scope for which to retrieve the prompt connections.scopeId- The ID of the scope for which to retrieve the prompt connections.- Returns:
- A list of all prompt connections associated with the specified scope and its child scopes.
-
getAllByScopeIncludeParents
Gets all prompt connections that belong to the specified scope, or a parent scope of that scope.- Parameters:
scopeKind- The kind of the scope for which to retrieve the prompt connections.scopeId- The ID of the scope for which to retrieve the prompt connections.- Returns:
- A list of all prompt connections associated with the specified scope and its parent scopes.
-
getAllByType
Finds all prompt connections of a given type from all scopes.- Parameters:
type- The type of prompt connections to retrieve.- Returns:
- A list of all prompt connections of the specified type.
-
getAllByType
Finds all prompt connections of a given type assigned to the specified scope.- Parameters:
type- The type of prompt connections to retrieve.scopeKind- The kind of the scope for which to retrieve the prompt connections.scopeId- The ID of the scope for which to retrieve the prompt connections.- Returns:
- A list of prompt connections of the specified type for the given scope.
-
getAllByTypeIncludeChildren
List<PromptConnectionEntity> getAllByTypeIncludeChildren(String type, String scopeKind, long scopeId) Finds all prompt connections of a given type assigned to the specified scope or a child of that scope.- Parameters:
type- The type of prompt connections to retrieve.scopeKind- The kind of the scope for which to retrieve the prompt connections.scopeId- The ID of the scope for which to retrieve the prompt connections.- Returns:
- A list of prompt connections of the specified type for the given scope.
-
getAllByTypeIncludeParents
List<PromptConnectionEntity> getAllByTypeIncludeParents(String type, String scopeKind, long scopeId) Finds all prompt connections of a given type assigned to the specified scope or a parent of that scope.- Parameters:
type- The type of prompt connections to retrieve.scopeKind- The kind of the scope for which to retrieve the prompt connections.scopeId- The ID of the scope for which to retrieve the prompt connections.- Returns:
- A list of prompt connections of the specified type for the given scope.
-
getByName
Gets a prompt connection with a given name that belongs to the specified scope.- Parameters:
scopeKind- The kind of the scope for which to retrieve the prompt connection.scopeId- The ID of the scope for which to retrieve the promptname- The name of the prompt connection to retrieve.- Returns:
- The prompt connection entity with the specified name, or null if not found.
-
getByQuery
Gets the prompt connection that wasconfiguredfor the given query.- Parameters:
scopeKind- The kind of the scope for which to retrieve the prompt connection.scopeId- The ID of the scope for which to retrieve the prompt connection.query- The UUID of the prompt query.- Returns:
- The prompt connection entity configured for the query with the given UUID, or null if not found.
-
getByUuid
Gets a prompt connection by its UUID with the specified scope.- Parameters:
scopeKind- The kind of the scope for which to retrieve the prompt connection.scopeId- The ID of the scope for which to retrieve the prompt connection.connection- The UUID of the prompt connection to retrieve.- Returns:
- The prompt connection entity with the specified scope, or null if not found.
-
getType
Gets thetypeof a prompt connection.- Parameters:
scopeKind- The kind of the scope for which to retrieve the prompt connection type.scopeId- The ID of the scope for which to retrieve the prompt connection type.connection- The UUID of the prompt connection for which to retrieve the type.- Returns:
- The type of the prompt connection, or null if not found.
-