A B C D E F G H I L M O P Q R S T U V W
All Classes All Packages
All Classes All Packages
All Classes All Packages
A
- addConstraint(Class<E>, SqlPredicate<E>) - Static method in class com.github.collinalpert.java2db.queries.QueryConstraints
-
Adds a query constraint to a query made with a certain entity.
- any() - Method in class com.github.collinalpert.java2db.services.BaseService
-
Checks if a table has at least one row.
- any(SqlPredicate<T>) - Method in class com.github.collinalpert.java2db.services.BaseService
-
Checks if a value matching the condition exists in the table.
- ASCENDING - com.github.collinalpert.java2db.queries.OrderTypes
B
- BaseCodeAndDescriptionEntity - Class in com.github.collinalpert.java2db.entities
-
Describes an entity that has an id, a code and a description.
- BaseCodeAndDescriptionEntity() - Constructor for class com.github.collinalpert.java2db.entities.BaseCodeAndDescriptionEntity
- BaseCodeAndDescriptionService<T extends BaseCodeAndDescriptionEntity> - Class in com.github.collinalpert.java2db.services
-
Describes a service class for an entity which contains an id, a code and a description.
- BaseCodeAndDescriptionService() - Constructor for class com.github.collinalpert.java2db.services.BaseCodeAndDescriptionService
- BaseEntity - Class in com.github.collinalpert.java2db.entities
-
Describes an entity that has an id.
- BaseEntity() - Constructor for class com.github.collinalpert.java2db.entities.BaseEntity
- BaseMapper<T extends BaseEntity> - Class in com.github.collinalpert.java2db.mappers
-
Default mapper for converting a
ResultSetto the respective Java entity. - BaseMapper(Class<T>) - Constructor for class com.github.collinalpert.java2db.mappers.BaseMapper
- BaseService<T extends BaseEntity> - Class in com.github.collinalpert.java2db.services
-
Class that provides base functionality for all service classes.
- BaseService() - Constructor for class com.github.collinalpert.java2db.services.BaseService
-
Constructor for the base class of all services.
C
- close() - Method in class com.github.collinalpert.java2db.database.DBConnection
-
Closes the connection to the database.
- com.github.collinalpert.java2db.annotations - package com.github.collinalpert.java2db.annotations
- com.github.collinalpert.java2db.database - package com.github.collinalpert.java2db.database
- com.github.collinalpert.java2db.entities - package com.github.collinalpert.java2db.entities
- com.github.collinalpert.java2db.exceptions - package com.github.collinalpert.java2db.exceptions
- com.github.collinalpert.java2db.mappers - package com.github.collinalpert.java2db.mappers
- com.github.collinalpert.java2db.queries - package com.github.collinalpert.java2db.queries
- com.github.collinalpert.java2db.services - package com.github.collinalpert.java2db.services
- com.github.collinalpert.java2db.utilities - package com.github.collinalpert.java2db.utilities
- ConnectionFailedException - Exception in com.github.collinalpert.java2db.exceptions
- ConnectionFailedException() - Constructor for exception com.github.collinalpert.java2db.exceptions.ConnectionFailedException
- count() - Method in class com.github.collinalpert.java2db.services.BaseService
-
An overload of the
BaseService.count(SqlPredicate)method. - count(SqlPredicate<T>) - Method in class com.github.collinalpert.java2db.services.BaseService
-
Counts the rows matching a certain condition.
- create(T) - Method in class com.github.collinalpert.java2db.services.BaseService
-
Creates this Java entity on the database.
D
- DATABASE - Static variable in class com.github.collinalpert.java2db.database.DBConnection
-
Specifies the name of the database to connect to.
- DATABASE_TYPE - Static variable in class com.github.collinalpert.java2db.database.DBConnection
-
Specifies the type of the database.
- DatabaseTypes - Enum in com.github.collinalpert.java2db.database
-
Enum for all database types this library supports.
- DBConnection - Class in com.github.collinalpert.java2db.database
- DBConnection() - Constructor for class com.github.collinalpert.java2db.database.DBConnection
- delete(long) - Method in class com.github.collinalpert.java2db.services.BaseService
-
Deletes a row by an id.
- delete(SqlPredicate<T>) - Method in class com.github.collinalpert.java2db.services.BaseService
-
Deletes rows based on a condition.
- delete(T) - Method in class com.github.collinalpert.java2db.services.BaseService
-
Deletes the corresponding row on the database.
- DESCENDING - com.github.collinalpert.java2db.queries.OrderTypes
E
- execute(String) - Method in class com.github.collinalpert.java2db.database.DBConnection
-
Executes a DQL statement on the database without Java parameters.
- execute(String, Object...) - Method in class com.github.collinalpert.java2db.database.DBConnection
-
Executes a DQL statement on the database with Java parameters.
F
- ForeignKeyObject - Annotation Type in com.github.collinalpert.java2db.annotations
-
Marks a field as the correspondent object to a foreign key.
- ForeignKeyReference - Class in com.github.collinalpert.java2db.database
-
Describes a foreign key reference containing the table and column of the
- ForeignKeyReference(String, String, String, String) - Constructor for class com.github.collinalpert.java2db.database.ForeignKeyReference
G
- generate(String, String) - Static method in class com.github.collinalpert.java2db.utilities.UniqueIdentifier
-
Generates a unique alias from a base.
- get() - Method in class com.github.collinalpert.java2db.queries.Query
-
Gets the values returned from the query.
- getAlias() - Method in class com.github.collinalpert.java2db.database.ForeignKeyReference
- getAlias() - Method in class com.github.collinalpert.java2db.database.TableNameColumnReference
- getAliasNotation() - Method in class com.github.collinalpert.java2db.database.TableNameColumnReference
- getAll() - Method in class com.github.collinalpert.java2db.services.BaseService
- getAll(int) - Method in class com.github.collinalpert.java2db.services.BaseService
-
Gets all values from the table but limits the result.
- getAll(SqlFunction<T, ?>) - Method in class com.github.collinalpert.java2db.services.BaseService
-
Gets all values from the table and orders them in an ascending order.
- getAll(SqlFunction<T, ?>, int) - Method in class com.github.collinalpert.java2db.services.BaseService
-
Gets all values from the table, orders them in an ascending order and limits the result.
- getAll(SqlFunction<T, ?>, OrderTypes) - Method in class com.github.collinalpert.java2db.services.BaseService
-
Gets all values from the table and orders them in the specified order.
- getAll(SqlFunction<T, ?>, OrderTypes, int) - Method in class com.github.collinalpert.java2db.services.BaseService
-
Gets all values from the table, orders them in a specific order and limits the result.
- getAllFields(Class<? extends BaseEntity>) - Static method in class com.github.collinalpert.java2db.utilities.Utilities
-
Gets all the fields and the fields of foreign key objects in this entity.
- getAllFields(Class<? extends BaseEntity>, String) - Static method in class com.github.collinalpert.java2db.utilities.Utilities
-
Gets all the fields and the fields of foreign key objects in this entity.
- getByCode(String) - Method in class com.github.collinalpert.java2db.services.BaseCodeAndDescriptionService
- getByDescription(String) - Method in class com.github.collinalpert.java2db.services.BaseCodeAndDescriptionService
- getById(long) - Method in class com.github.collinalpert.java2db.services.BaseService
- getChildTable() - Method in class com.github.collinalpert.java2db.database.ForeignKeyReference
- getCode() - Method in class com.github.collinalpert.java2db.entities.BaseCodeAndDescriptionEntity
- getColumn() - Method in class com.github.collinalpert.java2db.database.TableNameColumnReference
- getConstraints(Class<E>) - Static method in class com.github.collinalpert.java2db.queries.QueryConstraints
-
Retrieves a composition
SqlPredicatefor all constraints that have been added for this class or any superclass of it. - getDescription() - Method in class com.github.collinalpert.java2db.entities.BaseCodeAndDescriptionEntity
- getEntityFields(Class<? extends BaseEntity>) - Static method in class com.github.collinalpert.java2db.utilities.Utilities
- getEntityFields(Class<? extends BaseEntity>, boolean) - Static method in class com.github.collinalpert.java2db.utilities.Utilities
- getEntityFields(Class<? extends BaseEntity>, Class<?>) - Static method in class com.github.collinalpert.java2db.utilities.Utilities
- getFirst() - Method in class com.github.collinalpert.java2db.queries.Query
-
Gets the first row of a query.
- getFunction() - Method in class com.github.collinalpert.java2db.queries.OrderClause
- getId() - Method in class com.github.collinalpert.java2db.entities.BaseEntity
- getIdentifier() - Method in class com.github.collinalpert.java2db.database.TableNameColumnReference
- getIdentifier(String) - Static method in class com.github.collinalpert.java2db.utilities.UniqueIdentifier
-
Gets the alias for a certain nested property.
- getMultiple(SqlPredicate<T>) - Method in class com.github.collinalpert.java2db.services.BaseService
-
Retrieves list of entities which match the predicate.
- getOrderType() - Method in class com.github.collinalpert.java2db.queries.OrderClause
- getParentClass() - Method in class com.github.collinalpert.java2db.database.ForeignKeyReference
- getParentForeignKey() - Method in class com.github.collinalpert.java2db.database.ForeignKeyReference
- getQuery() - Method in class com.github.collinalpert.java2db.queries.Query
- getReference() - Method in class com.github.collinalpert.java2db.database.TableNameColumnReference
- getSingle(SqlPredicate<T>) - Method in class com.github.collinalpert.java2db.services.BaseService
-
Retrieves a single entity which matches the predicate.
- getSql() - Method in enum com.github.collinalpert.java2db.queries.OrderTypes
- getSQLNotation() - Method in class com.github.collinalpert.java2db.database.TableNameColumnReference
- getTableName(Class<?>) - Static method in class com.github.collinalpert.java2db.utilities.Utilities
-
Gets the database table name from the
TableNameattribute on the class.
H
- HOST - Static variable in class com.github.collinalpert.java2db.database.DBConnection
-
Specifies the hostname/ip address of the database.
I
- Ignore - Annotation Type in com.github.collinalpert.java2db.annotations
-
Maks a field as ignored meaning it does not exist on the database or should not be filled with values.
- IoC - Class in com.github.collinalpert.java2db.utilities
- IoC() - Constructor for class com.github.collinalpert.java2db.utilities.IoC
- isForeignKey() - Method in class com.github.collinalpert.java2db.database.TableNameColumnReference
- isMapperRegistered(Class<E>) - Static method in class com.github.collinalpert.java2db.utilities.IoC
-
Checks if a mapper has already been registered.
- isOpen() - Method in class com.github.collinalpert.java2db.database.DBConnection
-
Determines if a connection to the database still exists or not.
- isServiceRegistered(Class<E>) - Static method in class com.github.collinalpert.java2db.utilities.IoC
-
Checks if a service has already been registered.
- isValid() - Method in class com.github.collinalpert.java2db.database.DBConnection
-
Checks if the connection is valid/successful.
L
- limit(int) - Method in class com.github.collinalpert.java2db.queries.Query
-
Limits the result of the rows returned to a maximum of the passed integer.
- log(Object) - Static method in class com.github.collinalpert.java2db.utilities.Utilities
-
Prints messages to the query, while considering the
DBConnection.LOG_QUERIESconstant. - LOG_QUERIES - Static variable in class com.github.collinalpert.java2db.database.DBConnection
-
Constant which determines if the queries generated by Java2DB will be logged in the console.
- logf(String, Object...) - Static method in class com.github.collinalpert.java2db.utilities.Utilities
-
Prints formatted messages to the query, while considering the
DBConnection.LOG_QUERIESconstant.
M
- map(ResultSet) - Method in class com.github.collinalpert.java2db.mappers.BaseMapper
-
Maps a
ResultSetwith a single row to a Java entity. - map(ResultSet) - Method in interface com.github.collinalpert.java2db.mappers.Mapper
- Mapper<T extends BaseEntity> - Interface in com.github.collinalpert.java2db.mappers
- mapToList(ResultSet) - Method in class com.github.collinalpert.java2db.mappers.BaseMapper
-
Maps a
ResultSetwith multiple rows to a list of Java entities. - mapToList(ResultSet) - Method in interface com.github.collinalpert.java2db.mappers.Mapper
- MICROSOFT - com.github.collinalpert.java2db.database.DatabaseTypes
- MYSQL - com.github.collinalpert.java2db.database.DatabaseTypes
O
- orderBy(SqlFunction<T, ?>) - Method in class com.github.collinalpert.java2db.queries.Query
-
Sets an ORDER BY clause for the DQL statement.
- orderBy(SqlFunction<T, ?>, OrderTypes) - Method in class com.github.collinalpert.java2db.queries.Query
-
Sets an ORDER BY clause for the DQL statement.
- OrderClause<T extends BaseEntity> - Class in com.github.collinalpert.java2db.queries
-
Describes an SQL ORDER BY clause.
- OrderClause(SqlFunction<T, ?>) - Constructor for class com.github.collinalpert.java2db.queries.OrderClause
- OrderClause(SqlFunction<T, ?>, OrderTypes) - Constructor for class com.github.collinalpert.java2db.queries.OrderClause
- OrderTypes - Enum in com.github.collinalpert.java2db.queries
-
An enum representing the sorting order possibilities in a DQL statement.
P
- PASSWORD - Static variable in class com.github.collinalpert.java2db.database.DBConnection
-
Specifies the password to log in on the database with.
- PORT - Static variable in class com.github.collinalpert.java2db.database.DBConnection
-
Specifies the port to connect to the database on.
Q
- Query<T extends BaseEntity> - Class in com.github.collinalpert.java2db.queries
-
A class representing a DQL statement with different options, including where clauses, order by clauses and limits.
- Query(Class<T>, Mapper<T>) - Constructor for class com.github.collinalpert.java2db.queries.Query
-
Constructor for creating a DQL statement for a given entity.
- QueryConstraints - Class in com.github.collinalpert.java2db.queries
-
A class which administers default query constraints set for entities.
- QueryConstraints() - Constructor for class com.github.collinalpert.java2db.queries.QueryConstraints
R
- registerMapper(Class<E>, M) - Static method in class com.github.collinalpert.java2db.utilities.IoC
-
Registers an instance of a mapper class.
- registerService(Class<E>, S) - Static method in class com.github.collinalpert.java2db.utilities.IoC
-
Registers an instance of a service class.
- resolve(Class<E>) - Static method in class com.github.collinalpert.java2db.utilities.IoC
-
Creates an instance of any class with an empty constructor.
- resolveMapper(Class<E>) - Static method in class com.github.collinalpert.java2db.utilities.IoC
-
Resolves a mapper class.
- resolveService(Class<S>) - Static method in class com.github.collinalpert.java2db.utilities.IoC
-
Resolves a service class.
- resolveServiceByEntity(Class<E>) - Static method in class com.github.collinalpert.java2db.utilities.IoC
-
Resolves a service class by the entity it was registered with.
S
- setCode(String) - Method in class com.github.collinalpert.java2db.entities.BaseCodeAndDescriptionEntity
- setDescription(String) - Method in class com.github.collinalpert.java2db.entities.BaseCodeAndDescriptionEntity
- setFunction(SqlFunction<T, ?>) - Method in class com.github.collinalpert.java2db.queries.OrderClause
- setId(long) - Method in class com.github.collinalpert.java2db.entities.BaseEntity
-
This setter only exists for frameworks like Spring, where a form needs to set this id.
- setOrderType(OrderTypes) - Method in class com.github.collinalpert.java2db.queries.OrderClause
T
- TableName - Annotation Type in com.github.collinalpert.java2db.annotations
-
Specifies the database table name for an entity.
- TableNameColumnReference - Class in com.github.collinalpert.java2db.database
-
Describes a column and its table name so they can be referenced together.
- TableNameColumnReference(String, Field, String, String) - Constructor for class com.github.collinalpert.java2db.database.TableNameColumnReference
- toString() - Method in class com.github.collinalpert.java2db.database.TableNameColumnReference
- toString() - Method in class com.github.collinalpert.java2db.entities.BaseCodeAndDescriptionEntity
- toString() - Method in class com.github.collinalpert.java2db.entities.BaseEntity
- toString() - Method in class com.github.collinalpert.java2db.queries.Query
U
- UniqueIdentifier - Class in com.github.collinalpert.java2db.utilities
-
A factory class for generating unique identifiers.
- UniqueIdentifier() - Constructor for class com.github.collinalpert.java2db.utilities.UniqueIdentifier
- unset() - Static method in class com.github.collinalpert.java2db.utilities.UniqueIdentifier
-
Resets the values in this class.
- update(String) - Method in class com.github.collinalpert.java2db.database.DBConnection
-
This command is used for any DDL/DML queries.
- update(String, Object...) - Method in class com.github.collinalpert.java2db.database.DBConnection
-
This command is used for any DDL/DML queries with Java parameters.
- update(T) - Method in class com.github.collinalpert.java2db.services.BaseService
-
Updates this entity's row on the database.
- USERNAME - Static variable in class com.github.collinalpert.java2db.database.DBConnection
-
Specifies the username to log in on the database with.
- Utilities - Class in com.github.collinalpert.java2db.utilities
- Utilities() - Constructor for class com.github.collinalpert.java2db.utilities.Utilities
V
- value() - Method in annotation type com.github.collinalpert.java2db.annotations.ForeignKeyObject
- value() - Method in annotation type com.github.collinalpert.java2db.annotations.TableName
- valueOf(String) - Static method in enum com.github.collinalpert.java2db.database.DatabaseTypes
-
Returns the enum constant of this type with the specified name.
- valueOf(String) - Static method in enum com.github.collinalpert.java2db.queries.OrderTypes
-
Returns the enum constant of this type with the specified name.
- values() - Static method in enum com.github.collinalpert.java2db.database.DatabaseTypes
-
Returns an array containing the constants of this enum type, in the order they are declared.
- values() - Static method in enum com.github.collinalpert.java2db.queries.OrderTypes
-
Returns an array containing the constants of this enum type, in the order they are declared.
W
- where(SqlPredicate<T>) - Method in class com.github.collinalpert.java2db.queries.Query
-
Sets a WHERE clause for the DQL statement.
All Classes All Packages