Package jakarta.nosql.tck
Enum Class NoSQLType
- All Implemented Interfaces:
Serializable
,Comparable<NoSQLType>
,Constable
Enum representing various types of NoSQL databases supported by Jakarta NoSQL.
Each type is associated with a flexibility level, which indicates the database's
capability to perform queries beyond basic operations.
Flexibility Level:
The flexibility level reflects the ability of a NoSQL database type to retrieve
and query information beyond the key itself:
- KEY_VALUE (1): Key-value stores generally support queries using only the key, resulting in lower flexibility.
- COLUMN (2): Column-family databases offer more advanced querying capabilities, such as filtering rows based on column values, providing moderate flexibility.
- DOCUMENT (3): Document-based databases support rich querying capabilities over nested structures and fields within documents, leading to higher flexibility.
- GRAPH (4): Graph databases excel in querying relationships, relationship directions, and properties, making them the most flexible type among NoSQL databases.
- OTHER (0): Represents database types that do not fit into the other categories or have unknown flexibility.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionColumn-family databases organize data into rows and columns and allow advanced filtering and operations at the column level.Document-based databases store data in structured documents.Graph databases specialize in querying relationships and properties between entities.Key-value stores are databases optimized for simple key-based lookups.Represents database types that do not fall into the predefined categories or have an unknown level of flexibility. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic NoSQLType
get()
Retrieves the NoSQLType from the system propertyDATABASE_TYPE_PROPERTY
.static NoSQLType
Retrieves the NoSQLType based on the given type name.int
Returns the flexibility level of the current database type.static NoSQLType
Returns the enum constant of this class with the specified name.static NoSQLType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
KEY_VALUE
Key-value stores are databases optimized for simple key-based lookups. These databases have limited flexibility because they typically cannot perform advanced queries beyond retrieving values by keys. -
COLUMN
Column-family databases organize data into rows and columns and allow advanced filtering and operations at the column level. These databases offer moderate flexibility due to their ability to query based on column values. -
DOCUMENT
Document-based databases store data in structured documents. These databases enable rich queries over nested structures and fields, providing a high degree of flexibility for complex queries. -
GRAPH
Graph databases specialize in querying relationships and properties between entities. These databases offer the highest flexibility due to their ability to perform complex queries on nodes, edges, relationships, directions, and properties. -
OTHER
Represents database types that do not fall into the predefined categories or have an unknown level of flexibility. This category is used for custom or less common database types.
-
-
Field Details
-
DATABASE_TYPE_PROPERTY
The system property used to define the NoSQL database type.- See Also:
-
DEFAULT_DATABASE_TYPE
The default database type, used when no type is explicitly specified.- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getFlexibility
public int getFlexibility()Returns the flexibility level of the current database type. The flexibility score is determined based on the type's capability to perform queries beyond simple key-based lookups. For example:- Key-value stores typically only allow key-based lookups, resulting in a lower flexibility score.
- Graph databases enable complex queries involving relationships, directions, and properties, resulting in the highest flexibility score.
- Returns:
- the flexibility level
-
get
Retrieves the NoSQLType from the system propertyDATABASE_TYPE_PROPERTY
. If the property is not set, theDEFAULT_DATABASE_TYPE
is used.- Returns:
- the NoSQLType corresponding to the system property or default type
-
get
Retrieves the NoSQLType based on the given type name. If the type name is invalid, theDEFAULT_DATABASE_TYPE
is used.- Parameters:
type
- the name of the NoSQL type- Returns:
- the corresponding NoSQLType, or the default type if invalid
-