public abstract class DataBaseRepository<T> extends Object implements com.github.shynixn.petblocks.api.persistence.controller.IDatabaseController<T>
Do not remove this header!
Version 1.0
MIT License
Copyright (c) 2017
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Constructor and Description |
|---|
DataBaseRepository() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
delete(T item)
Deletes the item from the database
|
abstract T |
from(ResultSet resultSet)
Generates the entity from the given resultSet
|
List<T> |
getAll()
Returns all items from the repository as unmodifiableList
|
abstract boolean |
hasId(T item)
Checks if the item has got an valid databaseId
|
abstract void |
insert(T item)
Inserts the item into the database and sets the id
|
void |
remove(T item)
Removes an item from the repository
|
abstract List<T> |
select()
Selects all items from the database into the list
|
void |
store(T item)
Stores a new a item in the repository
|
abstract void |
update(T item)
Updates the item inside of the database
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetByIdsizeclosepublic void store(T item)
store in interface com.github.shynixn.petblocks.api.persistence.controller.IController<T>item - itempublic void remove(T item)
remove in interface com.github.shynixn.petblocks.api.persistence.controller.IController<T>item - itempublic List<T> getAll()
getAll in interface com.github.shynixn.petblocks.api.persistence.controller.IController<T>public abstract boolean hasId(T item)
item - itempublic abstract List<T> select()
public abstract void update(T item)
item - itempublic abstract void delete(T item)
item - itempublic abstract void insert(T item)
item - itempublic abstract T from(ResultSet resultSet) throws SQLException
resultSet - resultSetSQLException - exceptionCopyright © 2017. All rights reserved.