public class PetDataRepository extends DataBaseRepository<com.github.shynixn.petblocks.api.persistence.entity.PetMeta> implements com.github.shynixn.petblocks.api.persistence.controller.PetMetaController
| Constructor and Description |
|---|
PetDataRepository(ExtensionHikariConnectionContext connectionContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this resource, relinquishing any underlying resources.
|
com.github.shynixn.petblocks.api.persistence.entity.PetMeta |
create(Object player)
Creates a petMeta for the given player
|
void |
delete(com.github.shynixn.petblocks.api.persistence.entity.PetMeta item)
Deletes the item from the database
|
com.github.shynixn.petblocks.api.persistence.entity.PetMeta |
from(ResultSet resultSet)
Generates the entity from the given resultSet
|
com.github.shynixn.petblocks.api.persistence.entity.PetMeta |
getById(long id)
Returns the item of the given id
|
<T> com.github.shynixn.petblocks.api.persistence.entity.PetMeta |
getByPlayer(T player)
Returns the petdata from the given player
|
<T> boolean |
hasEntry(T player)
Checks if the player has got an entry in the database
|
boolean |
hasId(com.github.shynixn.petblocks.api.persistence.entity.PetMeta item)
Checks if the item has got an valid databaseId
|
void |
insert(com.github.shynixn.petblocks.api.persistence.entity.PetMeta itemMeta)
Inserts the item into the database and sets the id
|
void |
remove(com.github.shynixn.petblocks.api.persistence.entity.PetMeta item)
Removes an item from the repository
|
void |
removeByPlayer(Object player)
Removes the petMeta of the given player
|
List<com.github.shynixn.petblocks.api.persistence.entity.PetMeta> |
select()
Selects all items from the database into the list
|
int |
size()
Returns the amount of items in the repository
|
void |
store(com.github.shynixn.petblocks.api.persistence.entity.PetMeta item)
Stores a new a item in the repository
|
void |
update(com.github.shynixn.petblocks.api.persistence.entity.PetMeta itemMeta)
Updates the item inside of the database
|
getAllpublic PetDataRepository(ExtensionHikariConnectionContext connectionContext)
public void store(com.github.shynixn.petblocks.api.persistence.entity.PetMeta item)
store in interface com.github.shynixn.petblocks.api.persistence.controller.IController<com.github.shynixn.petblocks.api.persistence.entity.PetMeta>store in class DataBaseRepository<com.github.shynixn.petblocks.api.persistence.entity.PetMeta>item - itempublic void remove(com.github.shynixn.petblocks.api.persistence.entity.PetMeta item)
remove in interface com.github.shynixn.petblocks.api.persistence.controller.IController<com.github.shynixn.petblocks.api.persistence.entity.PetMeta>remove in class DataBaseRepository<com.github.shynixn.petblocks.api.persistence.entity.PetMeta>item - itempublic com.github.shynixn.petblocks.api.persistence.entity.PetMeta create(Object player)
create in interface com.github.shynixn.petblocks.api.persistence.controller.PetMetaControllerplayer - playerpublic <T> com.github.shynixn.petblocks.api.persistence.entity.PetMeta getByPlayer(T player)
getByPlayer in interface com.github.shynixn.petblocks.api.persistence.controller.PetMetaControllerplayer - playerpublic <T> boolean hasEntry(T player)
hasEntry in interface com.github.shynixn.petblocks.api.persistence.controller.PetMetaControllerplayer - playerpublic void removeByPlayer(Object player)
removeByPlayer in interface com.github.shynixn.petblocks.api.persistence.controller.PetMetaControllerplayer - playerpublic com.github.shynixn.petblocks.api.persistence.entity.PetMeta getById(long id)
getById in interface com.github.shynixn.petblocks.api.persistence.controller.IDatabaseController<com.github.shynixn.petblocks.api.persistence.entity.PetMeta>id - idpublic boolean hasId(com.github.shynixn.petblocks.api.persistence.entity.PetMeta item)
hasId in class DataBaseRepository<com.github.shynixn.petblocks.api.persistence.entity.PetMeta>item - itempublic List<com.github.shynixn.petblocks.api.persistence.entity.PetMeta> select()
select in class DataBaseRepository<com.github.shynixn.petblocks.api.persistence.entity.PetMeta>public void update(com.github.shynixn.petblocks.api.persistence.entity.PetMeta itemMeta)
update in class DataBaseRepository<com.github.shynixn.petblocks.api.persistence.entity.PetMeta>itemMeta - itempublic void delete(com.github.shynixn.petblocks.api.persistence.entity.PetMeta item)
delete in class DataBaseRepository<com.github.shynixn.petblocks.api.persistence.entity.PetMeta>item - itempublic void insert(com.github.shynixn.petblocks.api.persistence.entity.PetMeta itemMeta)
insert in class DataBaseRepository<com.github.shynixn.petblocks.api.persistence.entity.PetMeta>itemMeta - itempublic com.github.shynixn.petblocks.api.persistence.entity.PetMeta from(ResultSet resultSet) throws SQLException
from in class DataBaseRepository<com.github.shynixn.petblocks.api.persistence.entity.PetMeta>resultSet - resultSetSQLException - exceptionpublic int size()
size in interface com.github.shynixn.petblocks.api.persistence.controller.IController<com.github.shynixn.petblocks.api.persistence.entity.PetMeta>public void close()
throws Exception
try-with-resources statement.close in interface AutoCloseableException - if this resource cannot be closedCopyright © 2017. All rights reserved.