Package org.pjdbc.annotations
package org.pjdbc.annotations
Annotations for declaring PJDBC driver capabilities.
These annotations are used to generate the pjdbc.capabilities.json
manifest at compile time, ensuring the manifest stays in sync with the
actual driver implementations.
Core Annotations
DriverCapability- Declares driver metadata (prefix, description, capabilities)DriverParameter- Declares URL parameters accepted by the driverDriverDependency- Declares external dependencies (Maven artifacts)DriverSideEffects- Declares side effects (stateful, logging, network, etc.)
Example Usage
@DriverCapability(
prefix = "cache",
description = "Caches SELECT query results in memory",
capabilities = {"caching"}
)
@DriverParameter(name = "ttl", type = ParameterType.INTEGER,
description = "Time-to-live in seconds", defaultValue = "60")
@DriverParameter(name = "maxSize", type = ParameterType.INTEGER,
description = "Maximum cached entries", defaultValue = "1000")
@DriverSideEffects(stateful = true)
public class CachingDriver extends AbstractProxyDriver {
// ...
}
Manifest Generation
An annotation processor scans for these annotations during compilation
and generates the pjdbc.capabilities.json manifest. This ensures:
- Single source of truth (the code itself)
- No manual manifest updates required
- Build fails if annotations are missing or invalid
- See Also:
-
ClassDescriptionDeclares the capabilities and metadata of a PJDBC proxy driver.Container annotation for multiple
DriverDependencyannotations.Declares an external dependency required by a PJDBC proxy driver.Declares a URL parameter accepted by a PJDBC proxy driver.Parameter types supported by driver parameters.Container annotation for multipleDriverParameterannotations.Declares the side effects of a PJDBC proxy driver.