{"id":15056184,"url":"https://github.com/naoghuman/lib-database-objectdb","last_synced_at":"2025-10-04T16:30:43.984Z","repository":{"id":23735511,"uuid":"27109073","full_name":"Naoghuman/lib-database-objectdb","owner":"Naoghuman","description":"Lib-Database-ObjectDB is a library for easy accessing an ObjectDB database in a JavaFX \u0026 Maven desktop application.","archived":true,"fork":false,"pushed_at":"2018-09-24T17:51:42.000Z","size":197,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-24T21:48:37.769Z","etag":null,"topics":["database","java","java-8","java-library","javafx","javafx-8","javafx-library","library","maven","netbeans","objectdb"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Naoghuman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-25T04:30:00.000Z","updated_at":"2023-06-11T16:43:00.000Z","dependencies_parsed_at":"2022-08-28T00:12:22.024Z","dependency_job_id":null,"html_url":"https://github.com/Naoghuman/lib-database-objectdb","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Naoghuman%2Flib-database-objectdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Naoghuman%2Flib-database-objectdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Naoghuman%2Flib-database-objectdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Naoghuman%2Flib-database-objectdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Naoghuman","download_url":"https://codeload.github.com/Naoghuman/lib-database-objectdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219871410,"owners_count":16554408,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","java","java-8","java-library","javafx","javafx-8","javafx-library","library","maven","netbeans","objectdb"],"created_at":"2024-09-24T21:48:46.727Z","updated_at":"2025-10-04T16:30:38.692Z","avatar_url":"https://github.com/Naoghuman.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Lib-Database-ObjectDB\n===\n\n[![Build Status](https://travis-ci.org/Naoghuman/lib-database-objectdb.svg?branch=master)](https://travis-ci.org/Naoghuman/lib-database-objectdb)\n[![license: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![GitHub release](https://img.shields.io/github/release/Naoghuman/lib-database-objectdb.svg)](https://GitHub.com/Naoghuman/lib-database-objectdb/releases/)\n\n\n\n\nIntention\n---\n\nLib-Database-ObjectDB is a library for easy accessing an [ObjectDB] database in \na [JavaFX] \u0026amp; [Maven] desktop application.\n\n_Image:_ [UML] Lib-Database-ObjectDB v0.6.0  \n![UML-diagram_Lib-Database-ObjectDB_v0.6.0_2018-09-23_15-06.png][UML-diagram_Lib-Database-ObjectDB_v0.6.0_2018-09-23_15-06]\n\n\u003e __Hint__  \n\u003e The `UML` diagram is created with the `Online Modeling Platform` [GenMyModel].\n\n\n\nContent\n---\n\n* [Examples](#Examples)\n    - [How to register an database](#HoToReAnDa)\n    - [Create and update an `Exercise`](#CrAnUpAnEx)\n    - [Sample of the entity `Exercise`](#SaOfThEnEx)\n* [Api](#Api)\n    - [com.github.naoghuman.lib.database.core.DatabaseFacade](#DatabaseFacade)\n    - [com.github.naoghuman.lib.database.core.CrudService](#CrudService)\n    - [com.github.naoghuman.lib.database.core.Database](#Database)\n    - [com.github.naoghuman.lib.database.core.Converter](#Converter)\n    - [com.github.naoghuman.lib.database.core.ConverterFacade](#ConverterFacade)\n* [Download](#Download)\n* [Requirements](#Requirements)\n* [Installation](#Installation)\n* [Documentation](#Documentation)\n* [Contribution](#Contribution)\n* [License](#License)\n* [Autor](#Autor)\n* [Contact](#Contact)\n\n\n\nExamples\u003ca name=\"Examples\" /\u003e\n---\n\n\n### How to register an database\u003ca name=\"HoToReAnDa\" /\u003e\n\n```java\npublic class StartApplication extends Application {\n    ...\n    @Override\n    public void init() throws Exception {\n        // Register the resource-bundle\n        PropertiesFacade.getDefault().register(KEY__APPLICATION__RESOURCE_BUNDLE);\n        ...\n        // Register the database\n        DatabaseFacade.getDefault().register(Properties.getPropertyForApplication(KEY__APPLICATION__DATABASE));\n    }\n}\n\npublic interface IPropertiesConfiguration {\n    public static final String KEY__APPLICATION__RESOURCE_BUNDLE = \"/com/github/naoghuman/abclist/i18n/application.properties\"; // NOI18N\n    public static final String KEY__TESTDATA_APPLICATION__DATABASE = \"application.database\"; // NOI18N\n    ...\n}\n```\n\n\n### Create and update an `Exercise`\u003ca name=\"CrAnUpAnEx\" /\u003e\n\n```java\npublic class SqlProvider ... {\n    public void createExercise(final Exercise exercise) {\n        final StopWatch stopWatch = new StopWatch();\n        stopWatch.start();\n                \n        ExerciseSqlService.getDefault().create(exercise);\n        \n        stopWatch.split();\n        this.printToLog(stopWatch.toSplitString(), 1, \"createExercise(Exercise)\"); // NOI18N\n        stopWatch.stop();\n    }\n    ...\n    public void updateExercise(final Exercise exercise) {\n        final StopWatch stopWatch = new StopWatch();\n        stopWatch.start();\n        \n        ExerciseSqlService.getDefault().update(exercise);\n        \n        stopWatch.split();\n        this.printToLog(stopWatch.toSplitString(), 1, \"updateExercise(Exercise)\"); // NOI18N\n        stopWatch.stop();\n    }\n}\n\nfinal class ExerciseSqlService ... {\n    void create(Exercise exercise) {\n        if (Objects.equals(exercise.getId(), DEFAULT_ID)) {\n            exercise.setId(System.currentTimeMillis());\n            DatabaseFacade.getDefault().getCrudService().create(exercise);\n        }\n        else {\n            this.update(exercise);\n        }\n    }\n    ...\n    void update(Exercise exercise) {\n        DatabaseFacade.getDefault().getCrudService().update(exercise);\n    }\n}\n```\n\n\n### Sample of the entity `Exercise`\u003ca name=\"SaOfThEnEx\" /\u003e\n\n```java\n@Entity\n@Access(AccessType.PROPERTY)\n@Table(name = IExerciseConfiguration.ENTITY__TABLE_NAME__EXERCISE)\n@NamedQueries({\n    @NamedQuery(\n            name = IExerciseConfiguration.NAMED_QUERY__NAME__FIND_ALL_WITH_TOPIC_ID,\n            query = IExerciseConfiguration.NAMED_QUERY__QUERY__FIND_ALL_WITH_TOPIC_ID)\n})\npublic class Exercise implements Comparable\u003cExercise\u003e, Externalizable, IDefaultConfiguration, IExerciseConfiguration {\n    ...\n\n    public Exercise(long id, long topicId, long generationTime, boolean consolidated, boolean ready) {\n        this.init(id, topicId, generationTime, consolidated, ready);\n    }\n    \n    private void init(long id, long topicId, long generationTime, boolean consolidated, boolean ready) {\n        this.setId(id);\n        this.setTopicId(topicId);\n        this.setGenerationTime(generationTime);\n        this.setConsolidated(consolidated);\n        this.setReady(ready);\n    }\n    \n    // START  ID ---------------------------------------------------------------\n    private LongProperty idProperty;\n    private long _id = DEFAULT_ID;\n\n    @Id\n    @Column(name = EXERCISE__COLUMN_NAME__ID)\n    public long getId() {\n        if (idProperty == null) {\n            return _id;\n        } else {\n            return idProperty.get();\n        }\n    }\n\n    public final void setId(long id) {\n        if (idProperty == null) {\n            _id = id;\n        } else {\n            idProperty.set(id);\n        }\n    }\n\n    public LongProperty idProperty() {\n        if (idProperty == null) {\n            idProperty = new SimpleLongProperty(this, EXERCISE__COLUMN_NAME__ID, _id);\n        }\n        \n        return idProperty;\n    }\n    // END  ID -----------------------------------------------------------------\n\n    ...\n\n    @Override\n    public String toString() {\n        return new ToStringBuilder(this)\n                .append(EXERCISE__COLUMN_NAME__ID,              this.getId())\n                .append(EXERCISE__COLUMN_NAME__TOPIC_ID,        this.getTopicId())\n                .append(EXERCISE__COLUMN_NAME__GENERATION_TIME, this.getGenerationTime())\n                .append(EXERCISE__COLUMN_NAME__FINISHED_TIME,   this.getFinishedTime())\n                .append(EXERCISE__COLUMN_NAME__CONSOLIDATED,    this.isConsolidated())\n                .append(EXERCISE__COLUMN_NAME__READY,           this.isReady())\n                .append(EXERCISE__COLUMN_NAME__CHOOSEN_TIME,    this.getChoosenTime())\n                .toString();\n    }\n    \n    @Override\n    public void writeExternal(ObjectOutput out) throws IOException {\n        out.writeLong(this.getId());\n        out.writeLong(this.getTopicId());\n        out.writeLong(this.getGenerationTime());\n        out.writeLong(this.getFinishedTime());\n        out.writeBoolean(this.isConsolidated());\n        out.writeBoolean(this.isReady());\n        out.writeObject(this.getChoosenTime());\n    }\n\n    @Override\n    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {\n        this.setId(in.readLong());\n        this.setTopicId(in.readLong());\n        this.setGenerationTime(in.readLong());\n        this.setFinishedTime(in.readLong());\n        this.setConsolidated(in.readBoolean());\n        this.setReady(in.readBoolean());\n        this.setChoosenTime(String.valueOf(in.readObject()));\n    }\n}\n\npublic interface IExerciseConfiguration {\n    public static final String NAMED_QUERY__NAME__FIND_ALL_WITH_TOPIC_ID = \"Exercise.findAllWithTopicId\"; // NOI18N\n    public static final String NAMED_QUERY__QUERY__FIND_ALL_WITH_TOPIC_ID = \"SELECT e FROM Exercise e WHERE e.topicId == :topicId\"; // NOI18N\n    ...\n}\n```\n\n\n\nApi\u003ca name=\"Api\" /\u003e\n----\n\n\n### com.github.naoghuman.lib.database.core.DatabaseFacade\u003ca name=\"DatabaseFacade\" /\u003e\n\n```java\n/**\n * The facade {@link com.github.naoghuman.lib.database.core.DatabaseFacade} \n * provides access to the default implementation from the {@code Interface} \n * {@link com.github.naoghuman.lib.database.core.Database} which is \n * {@link com.github.naoghuman.lib.database.internal.DefaultDatabase}.\n *\n * @author Naoghuman\n * @see com.github.naoghuman.lib.database.core.Database\n * @see com.github.naoghuman.lib.database.internal.DefaultDatabase\n */\npublic final class DatabaseFacade implements Database\n```\n\n```java\n/**\n * Returns a singleton instance from the class {@code DatabaseFacade}.\n * \n * @return a singleton instance from the class {@code DatabaseFacade}.\n */\npublic static final DatabaseFacade getDefault();\n```\n\n\n### com.github.naoghuman.lib.database.core.Database\u003ca name=\"Database\" /\u003e\n\n```java\n/**\n * The {@code Interface} for the {@code Implementation} {@code Class} \n * {@link com.github.naoghuman.lib.database.internal.DefaultDatabase}.\u003cbr\u003e\n * Over the facade {@link com.github.naoghuman.lib.database.core.DatabaseFacade} \n * the developer can access to the default {@code Implementation} methods from \n * this {@code Interface}.\n *\n * @author Naoghuman\n * @see    com.github.naoghuman.lib.database.core.DatabaseFacade\n * @see    com.github.naoghuman.lib.database.internal.DefaultDatabase\n */\npublic interface Database\n```\n\n```java\n/**\n * Allowed the developer to drop the defined database.\u003cbr\u003e\n * This method can be used for testing purpose.\n * \n * @param database The database which should be dropped.\n */\npublic void drop(final String database);\n```\n\n```java\n/**\n * Returns a {@link com.github.naoghuman.lib.database.core.CrudService} with \n * the name {@code DEFAULT} which allowed all sql operations.\n * \n * @return The {@code CrudService}.\n * @see    com.github.naoghuman.lib.database.core.CrudService\n */\npublic CrudService getCrudService();\n```\n\n```java\n/**\n * Returns a named {@link com.github.naoghuman.lib.database.core.CrudService} \n * which allowed all sql operations.\n * \n * @param  name The name from the {@code CrudService}.\n * @return The {@code CrudService}.\n * @see    com.github.naoghuman.lib.database.core.CrudService\n */\npublic CrudService getCrudService(final String name);\n```\n\n```java\n/**\n * Returns a named {@link javax.persistence.EntityManager} which allowed \n * all sql operations.\n * \n * @param  name The name from the {@code EntityManager}.\n * @return The {@code EntityManager}.\n * @see    javax.persistence.EntityManager\n */\npublic EntityManager getEntityManager(final String name);\n```\n\n```java\n/**\n * Creates a database with the specific parameter in the folder\n * {@code System.getProperty(\"user.dir\") + File.separator + \"database\"} \n * if it not exists.\u003cbr\u003e\n * If the parameter have no suffix {@code .odb} then the suffix will be\n * automatically added, otherwise not.\n * \n * @param database The name for the database which should be created.\n */\npublic void register(final String database);\n```\n\n```java\n/**\n * Removes a {@link com.github.naoghuman.lib.database.core.CrudService} with \n * the given name. Also the associated {@link javax.persistence.EntityManager} \n * will be removed.\n * \n * @param name The name for the {@code CrudService} which should be removed.\n * @see   com.github.naoghuman.lib.database.core.CrudService\n * @see   com.github.naoghuman.lib.database.core.Database#removeEntityManager(java.lang.String)\n * @see   javax.persistence.EntityManager\n */\npublic void removeCrudService(final String name);\n```\n\n```java\n/**\n * Removes a {@link javax.persistence.EntityManager} with the given name. Also\n * the associated {@link com.github.naoghuman.lib.database.core.CrudService} \n * will be removed.\n * \n * @param name The name for the {@code EntityManager} which should be removed.\n * @see com.github.naoghuman.lib.database.core.Database#removeCrudService(java.lang.String)\n */\npublic void removeEntityManager(final String name);\n```\n\n```java\n/**\n * Close the previous registered database.\n * \n * @see com.github.naoghuman.lib.database.core.Database#register(java.lang.String)\n */\npublic void shutdown();\n```\n\n\n### com.github.naoghuman.lib.database.core.CrudService\u003ca name=\"CrudService\" /\u003e\n\n```java\n/**\n * The {@code Interface} for the default {@code Implementation} class \n * {@link com.github.naoghuman.lib.database.internal.DefaultCrudService}.\u003cbr\u003e\n * A common {@code Interface} for all CRUD operations. The type of the entity is \n * specified in the {@code Implementation}.\n *\n * @author Naoghuman\n * @see    com.github.naoghuman.lib.database.core.DatabaseFacade\n * @see    com.github.naoghuman.lib.database.internal.DefaultCrudService\n */\npublic interface CrudService\n```\n\n```java\n/**\n * Start a resource transaction.\n * \u003cp\u003e\n * Internal following methods in following order will be executed:\u003cbr\u003e\n * \u003cul\u003e\n * \u003cli\u003e{@link javax.persistence.EntityTransaction#begin()}\u003c/li\u003e\n * \u003c/ul\u003e\n * \n * @see javax.persistence.EntityTransaction#begin()\n */\npublic void beginTransaction();\n```\n\n```java\n/**\n * Commits the current resource transaction, writing any unflushed changes \n * to the database.\n * \u003cp\u003e\n * Internal following methods in following order will be executed:\u003cbr\u003e\n * \u003cul\u003e\n * \u003cli\u003e{@link javax.persistence.EntityTransaction#commit()}\u003c/li\u003e\n * \u003cli\u003e{@link javax.persistence.EntityManager#clear()}\u003c/li\u003e\n * \u003c/ul\u003e\n * \n * @see javax.persistence.EntityManager#clear()\n * @see javax.persistence.EntityTransaction#commit()\n */\npublic void commitTransaction();\n```\n\n```java\n/**\n * Counts all entitys in the given {@code table}.\u003cbr\u003e\n * Creates the {@code sql} instruction \u003ci\u003eSELECT COUNT(c) FROM table c\u003c/i\u003e which\n * will then executed with {@link javax.persistence.EntityManager#createQuery(java.lang.String, java.lang.Class)}.\n * \n * @param  table The table which entitys should be counted.\n * @return The number of entitys in the table or {@code -1} if the table doesn't exists.\n * @see    javax.persistence.EntityManager#createQuery(java.lang.String, java.lang.Class)\n */\npublic Long count(final String table);\n```\n\n```java\n/**\n * Makes an entity managed and persistent. Synchronize the persistence context \n * to the underlying database and refresh the state of the instance from the \n * database, overwriting changes made to the entity, if any.\u003cbr\u003e\n * Delegates to {@link com.github.naoghuman.lib.database.core.CrudService#create(java.lang.Object, java.lang.Boolean)}\n * with the parameter {@code isSingleTransaction == true}.\n * \n * @param  \u003cT\u003e the type of the entity\n * @param  entity entity instance\n * @return a created persisted instance which the given type\n * @see    com.github.naoghuman.lib.database.core.CrudService#create(java.lang.Object, java.lang.Boolean)\n */\npublic \u003cT\u003e T create(final T entity);\n```\n\n```java\n/**\n * Makes an entity managed and persistent. Synchronize the persistence context \n * to the underlying database and refresh the state of the instance from the \n * database, overwriting changes made to the entity, if any. \n * \u003cp\u003e\n * Internal following methods in following order will be executed:\u003cbr\u003e\n * \u003cul\u003e\n * \u003cli\u003eif {@code isSingleTransaction == true} then {@link com.github.naoghuman.lib.database.core.CrudService#beginTransaction()}\u003c/li\u003e\n * \u003cli\u003e{@link javax.persistence.EntityManager#persist(java.lang.Object)}\u003c/li\u003e\n * \u003cli\u003e{@link javax.persistence.EntityManager#flush() }\u003c/li\u003e\n * \u003cli\u003e{@link javax.persistence.EntityManager#refresh(java.lang.Object)}\u003c/li\u003e\n * \u003cli\u003eif {@code isSingleTransaction == true} then {@link com.github.naoghuman.lib.database.core.CrudService#commitTransaction()}\u003c/li\u003e\n * \u003c/ul\u003e\n * \n * @param  \u003cT\u003e    the type of the entity\n * @param  entity entity instance\n * @param  isSingleTransaction flag if is transaction a single transaction or not.\n * @return a created persisted instance which the given type\n * @see    com.github.naoghuman.lib.database.core.CrudService#beginTransaction()\n * @see    com.github.naoghuman.lib.database.core.CrudService#commitTransaction()\n * @see    com.github.naoghuman.lib.database.core.CrudService#create(java.lang.Object)\n * @see    javax.persistence.EntityManager#flush()\n * @see    javax.persistence.EntityManager#persist(java.lang.Object)\n * @see    javax.persistence.EntityManager#refresh(java.lang.Object)\n */\npublic \u003cT\u003e T create(final T entity, final Boolean isSingleTransaction);\n```\n\n```java\n/**\n * Remove the entity instance from the database.\u003cbr\u003e\n * Deletes to {@link com.github.naoghuman.lib.database.core.CrudService#delete(java.lang.Class, java.lang.Object, java.lang.Boolean)}\n * with the parameter {@code isSingleTransaction == true}.\n * \n * @param \u003cT\u003e the type of the entity\n * @param type the entity class\n * @param id the primary key\n * @see   com.github.naoghuman.lib.database.core.CrudService#delete(java.lang.Class, java.lang.Object, java.lang.Boolean) \n */\npublic \u003cT\u003e void delete(final Class\u003cT\u003e type, final Object id);\n```\n\n```java\n/**\n * Remove the entity instance from the database.\u003cbr\u003e\n * \u003cp\u003e\n * Internal following methods in following order will be executed:\u003cbr\u003e\n * \u003cul\u003e\n * \u003cli\u003eif {@code isSingleTransaction == true} then {@link com.github.naoghuman.lib.database.core.CrudService#beginTransaction()}\u003c/li\u003e\n * \u003cli\u003e{@link javax.persistence.EntityManager#getReference(java.lang.Class, java.lang.Object)}\u003c/li\u003e\n * \u003cli\u003e{@link javax.persistence.EntityManager#remove(java.lang.Object)}\u003c/li\u003e\n * \u003cli\u003eif {@code isSingleTransaction == true} then {@link com.github.naoghuman.lib.database.core.CrudService#commitTransaction()}\u003c/li\u003e\n * \u003c/ul\u003e\n * \n * @param \u003cT\u003e the type of the entity\n * @param type the entity class\n * @param id the primary key\n * @param isSingleTransaction flag if is transaction a single transaction or not.\n * @see   com.github.naoghuman.lib.database.core.CrudService#delete(java.lang.Class, java.lang.Object)\n * @see   javax.persistence.EntityManager#getReference(java.lang.Class, java.lang.Object)\n * @see   javax.persistence.EntityManager#remove(java.lang.Object)\n */\npublic \u003cT\u003e void delete(final Class\u003cT\u003e type, final Object id, final Boolean isSingleTransaction);\n```\n\n```java\n/**\n * Returns the associated {@link javax.persistence.EntityManager}.\n * \n * @return The EntityManager.\n */\npublic EntityManager getEntityManager();\n```\n\n```java\n/**\n * TODO Add JavaDoc\u003cbr\u003e\n * Delegates to {@link com.github.naoghuman.lib.database.core.CrudService#update(java.lang.Object, java.lang.Boolean) }\n * with the parameter {@code isSingleTransaction == true}.\n * \n * @param  \u003cT\u003e the type of the entity\n * @param  entity entity instance\n * @return \n * @see    com.github.naoghuman.lib.database.core.CrudService#update(java.lang.Object, java.lang.Boolean) \n */\npublic \u003cT\u003e T update(final T entity);\n```\n\n```java\n/**\n * Merge the state of the given entity into the current persistence context.\n * \n * @param  \u003cT\u003e the type of the entity\n * @param  entity entity instance\n * @param  isSingleTransaction flag if is transaction a single transaction or not.\n * @return \n * @see    com.github.naoghuman.lib.database.core.CrudService#update(java.lang.Object) \n */\npublic \u003cT\u003e T update(final T entity, final Boolean isSingleTransaction);\n```\n\n```java\n/**\n * Find by primary key. Search for an entity of the specified class and \n * primary key. If the entity instance is contained in the persistence \n * context, it is returned from there.\n * \n * @param  \u003cT\u003e the type of the entity\n * @param  type the entity class\n * @param  id the primary key\n * @return \n */\npublic \u003cT\u003e T findById(final Class\u003cT\u003e type, final Object id);\n```\n\n```java\n/**\n * TODO Add JavaDoc\n * \n * @param  \u003cT\u003e the type of the entity\n * @param  type the entity class\n * @param  queryName\n * @return \n */\npublic \u003cT\u003e List\u003cT\u003e findByNamedQuery(final Class\u003cT\u003e type, final String queryName);\n```\n\n```java\n/**\n * TODO Add JavaDoc\n * \n * @param  \u003cT\u003e the type of the entity\n * @param  type the entity class\n * @param  queryName\n * @param  resultLimit\n * @return \n */\npublic \u003cT\u003e List\u003cT\u003e findByNamedQuery(final Class\u003cT\u003e type, final String queryName, final int resultLimit);\n```\n\n```java\n/**\n * TODO Add JavaDoc\n * \n * @param  \u003cT\u003e the type of the entity\n * @param  type the entity class\n * @param  queryName\n * @param  parameters\n * @return \n */\npublic \u003cT\u003e List\u003cT\u003e findByNamedQuery(final Class\u003cT\u003e type, final String queryName, final Map\u003cString, Object\u003e parameters);\n```\n\n```java\n/**\n * TODO Add JavaDoc\n * \n * @param  \u003cT\u003e the type of the entity\n * @param  type the entity class\n * @param  queryName\n * @param  parameters\n * @param  resultLimit\n * @return \n */\npublic \u003cT\u003e List\u003cT\u003e findByNamedQuery(final Class\u003cT\u003e type, final String queryName, final Map\u003cString, Object\u003e parameters, final int resultLimit);\n```\n\n```java\n/**\n * TODO Add JavaDoc\n * \n * @param  \u003cT\u003e the type of the entity\n * @param  type the entity class\n * @param  sql\n * @return \n */\npublic \u003cT\u003e List\u003cT\u003e findByNativeQuery(final Class\u003cT\u003e type, final String sql);\n```\n\n```java\n/**\n * TODO Add JavaDoc\n * \n * @param  \u003cT\u003e the type of the entity\n * @param  type the entity class\n * @param  sql\n * @param  resultLimit\n * @return \n */\npublic \u003cT\u003e List\u003cT\u003e findByNativeQuery(final Class\u003cT\u003e type, final String sql, final int resultLimit);\n```\n\n```java\n/**\n * TODO Add JavaDoc\n * \n * @param  \u003cT\u003e the type of the entity\n * @param  type the entity class\n * @param  sql\n * @param  parameters\n * @return \n */\npublic \u003cT\u003e List\u003cT\u003e findByNativeQuery(final Class\u003cT\u003e type, final String sql, final Map\u003cString, Object\u003e parameters);\n```\n\n```java\n/**\n * TODO Add JavaDoc\n * \n * @param  \u003cT\u003e the type of the entity\n * @param  type the entity class\n * @param  sql\n * @param  parameters\n * @param  resultLimit\n * @return \n */\npublic \u003cT\u003e List\u003cT\u003e findByNativeQuery(final Class\u003cT\u003e type, final String sql, final Map\u003cString, Object\u003e parameters, final int resultLimit);\n```\n\n```java\n/**\n * TODO Add JavaDoc\n * \n * @param name \n */\npublic void shutdown(final String name);\n```\n\n\n### com.github.naoghuman.lib.database.core.Converter\u003ca name=\"Converter\" /\u003e\n\n```java\n/**\n * This {@code Interface} allowed to convert objects to a {@link java.lang.String} \n * and returned to the given type.\n * \u003cp\u003e\n * For example with the facade {@link com.github.naoghuman.lib.database.core.ConverterFacade} \n * the developer have momentary the possiblility to convert a {@code JavaFX} color \n * or a {@link java.time.LocalDateTime}.\n * \n * @param  \u003cT\u003e the type of class which should be convert.\n * @author Naoghuman\n * @since  0.6.0\n * @see    com.github.naoghuman.lib.database.core.ConverterFacade\n * @see    java.lang.String\n * @see    java.time.LocalDateTime\n * @see    javafx.scene.paint.Color\n */\npublic interface Converter\u003cT\u003e\n```\n\n```java\n/**\n * Definition from a constant for the used delimiter ({@code ;}) in context \n * from this {@code Interface}.\n * \n * @since  0.6.0\n * @author Naoghuman\n */\npublic static final String DELIMITER = \";\"; // NOI18N\n```\n\n```java\n/**\n * Converts the internal values (separated with the delimiter {@code ';'}) \n * from the given object to a {@link java.lang.String}.\n * \u003cbr\u003e\n * To separate the internal values the developer can use the constant \n * {@link com.github.naoghuman.lib.database.core.Converter#DELIMITER}.\n * \u003cp\u003e\n * For example converting the JavaFX color {@link javafx.scene.paint.Color#BLACK} with \n * {@link com.github.naoghuman.lib.database.core.ConverterFacade#getColorConverter()} \n * will returns the String {@code 0.0;0.0;0.0;1.0}.\n * \n * @param  value the object which internal values should be convert to a {@code String}.\n * @return a {@code String} which presented the internal values from the given object.\n * @throws java.lang.NullPointerException if value is {@code NULL}.\n * @since  0.6.0\n * @author Naoghuman\n * @see    com.github.naoghuman.lib.database.core.Converter#DELIMITER\n * @see    com.github.naoghuman.lib.database.core.ConverterFacade#getColorConverter()\n * @see    java.lang.String\n * @see    javafx.scene.paint.Color#BLACK\n */\npublic String to(final T value);\n```\n\n```java\n/**\n * Converts the {@code value} to the given class. If the {@link java.lang.String} \n * can't converted to the given type then {@link java.util.Optional#empty()} \n * will returned.\n * \u003cp\u003e\n * The string should be a {@code separated value list} separated with the \n * delimiter {@code ';'}. See also \n * {@link com.github.naoghuman.lib.database.core.Converter#DELIMITER}.\n * \n * @param  value the object which should be converted returned to the given type.\n * @return an instance from the given class or {@link java.util.Optional#empty()}.\n * @throws java.lang.IllegalArgumentException if value is {@code EMPTY}.\n * @throws java.lang.NullPointerException if value is {@code NULL}.\n * @since  0.6.0\n * @author Naoghuman\n * @see    com.github.naoghuman.lib.database.core.Converter#DELIMITER\n * @see    java.lang.String\n * @see    java.util.Optional\n */\npublic Optional\u003cT\u003e from(final String value);\n```\n\n\n### com.github.naoghuman.lib.database.core.ConverterFacade\u003ca name=\"ConverterFacade\" /\u003e\n\n```java\n/**\n * The facade {@code ConverterFacade} allowed access to existing default implementations \n * from the {@code Interface} {@link com.github.naoghuman.lib.database.core.Converter}.\n * \u003cp\u003e\n * Momentary following default implementations exists:\n * \u003cul\u003e\n * \u003cli\u003e{@link com.github.naoghuman.lib.database.internal.DefaultColorConverter}\u003c/li\u003e\n * \u003cli\u003e{@link com.github.naoghuman.lib.database.internal.DefaultLocalDateTimeConverter}\u003c/li\u003e\n * \u003c/ul\u003e\n *\n * @since  0.6.0\n * @author Naoghuman\n * @see    com.github.naoghuman.lib.database.core.Converter\n * @see    com.github.naoghuman.lib.database.internal.DefaultColorConverter\n * @see    com.github.naoghuman.lib.database.internal.DefaultLocalDateTimeConverter\n */\npublic final class ConverterFacade\n```\n\n```java\n/**\n * Returns a singleton instance from the class {@link com.github.naoghuman.lib.database.core.ConverterFacade}.\n * \n * @return a singleton instance from this class.\n * @since  0.6.0\n * @author Naoghuman\n */\npublic static final ConverterFacade getDefault()\n```\n\n\n\nDownload\u003ca name=\"Download\" /\u003e\n---\n\nCurrent `version` is `0.6.0`. Main points in this release are:\n* This is a mayor update.\n* Bind the github project to travis.com for stability.\n* Add badges from img.shield.io to the ReadMe for additional informations.\n* Add new interface `Converter` to the api. Alloweds to convert objects to \n  Strings and back again.\n\n**Maven coordinates**  \n```xml\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.github.naoghuman\u003c/groupId\u003e\n        \u003cartifactId\u003elib-database-objectdb\u003c/artifactId\u003e\n        \u003cversion\u003e0.6.0\u003c/version\u003e\n    \u003c/dependency\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.github.naoghuman\u003c/groupId\u003e\n        \u003cartifactId\u003elib-logger\u003c/artifactId\u003e\n        \u003cversion\u003e0.6.0\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\nDownload:\n* [Release v0.6.0 (09.24.2017 / MM.dd.yyyy)]\n\nAn overview about all existings releases can be found here:\n* [Overview from all releases in Lib-Database-ObjectDB]\n\n\n\nRequirements\u003ca name=\"Requirements\" /\u003e\n---\n\n* On your system you need [JRE 8] or [JDK 8] installed.\n* The library [lib-database-objectdb-0.6.0.jar](#Installation).\n  * Included is the [objectdb-2.7.6.jar].\n  * Included is the [javax.persistence-2.2.1.jar].\n  * Included is the [javax.transaction-1.1.jar].\n\nIn the library are following libraries registered as dependencies:\n* The library [lib-logger-0.6.0.jar](#Installation).\n  * Included in `Lib-Logger` is the library [log4j-api-2.10.0.jar].\n  * Included is `Lib-Logger` is the library [log4j-core-2.10.0.jar].\n\n\nInstallation\u003ca name=\"Installation\" /\u003e\n---\n\n* If not installed download the [JRE 8] or the [JDK 8].\n  * Optional: To work better with [FXML] files in a [JavaFX] application \n    download the [JavaFX Scene Builder] under 'Additional Resources'.\n* Choose your preferred IDE (e.g. [NetBeans], [Eclipse] or [IntelliJ IDEA]) for \n  development.\n* Download or clone [Lib-Database-ObjectDB].\n* Download or clone [Lib-Logger].\n* Open the projects in your IDE and run them.\n\n\nDocumentation\u003ca name=\"Documentation\" /\u003e\n---\n\n* In section [Api](#Api) you can see the main point(s) to access the functionality \n  in this library.\n* For additional information see the [JavaDoc] in the library itself.\n\n\n\nContribution\u003ca name=\"Contribution\" /\u003e\n---\n\n* If you find a `Bug` I will be glad if you will report an [Issue].\n* If you want to contribute to the project plz fork the project and do a [Pull Request].\n\n\n\nLicense\u003ca name=\"License\" /\u003e\n---\n\nThe project `Lib-Database-ObjectDB` is licensed under [General Public License 3.0].\n\n\n\nAutor\u003ca name=\"Autor\" /\u003e\n---\n\nThe project `Lib-Database-ObjectDB` is maintained by me, Peter Rogge. See [Contact](#Contact).\n\n\n\nContact\u003ca name=\"Contact\" /\u003e\n---\n\nYou can reach me under \u003cpeter.rogge@yahoo.de\u003e.\n\n\n\n[//]: # (Images)\n[UML-diagram_Lib-Database-ObjectDB_v0.6.0_2018-09-23_15-06]:https://user-images.githubusercontent.com/8161815/45928357-88e11800-bf42-11e8-8e17-1c391f677ca4.png\n\n\n\n[//]: # (Links)\n[Eclipse]:https://www.eclipse.org/\n[FXML]:http://docs.oracle.com/javafx/2/fxml_get_started/jfxpub-fxml_get_started.htm\n[General Public License 3.0]:http://www.gnu.org/licenses/gpl-3.0.en.html\n[GenMyModel]:https://www.genmymodel.com/\n[IntelliJ IDEA]:http://www.jetbrains.com/idea/\n[Issue]:https://github.com/Naoghuman/lib-database-objectdb/issues\n[JavaDoc]:http://www.oracle.com/technetwork/java/javase/documentation/index-jsp-135444.html\n[JavaFX]:http://docs.oracle.com/javase/8/javase-clienttechnologies.htm\n[JavaFX Scene Builder]:http://gluonhq.com/labs/scene-builder/\n[javax.persistence-2.2.1.jar]:http://search.maven.org/#artifactdetails|org.eclipse.persistence|javax.persistence|2.2.1|jar\n[javax.transaction-1.1.jar]:http://mvnrepository.com/artifact/javax.transaction/jta\n[JDK 8]:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html\n[JRE 8]:http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html\n[Lib-Database-ObjectDB]:https://github.com/Naoghuman/lib-database-objectdb\n[Lib-Logger]:https://github.com/Naoghuman/lib-logger\n[log4j-api-2.10.0.jar]:https://logging.apache.org/log4j/2.0/log4j-web/dependencies.html\n[log4j-core-2.10.0.jar]:https://logging.apache.org/log4j/2.0/log4j-web/dependencies.html\n[Maven]:http://maven.apache.org/\n[NetBeans]:https://netbeans.org/\n[ObjectDB]:http://www.objectdb.com/\n[objectdb-2.7.6.jar]:http://www.objectdb.com/object/db/database/download\n[Overview from all releases in Lib-Database-ObjectDB]:https://github.com/Naoghuman/lib-database-objectdb/releases\n[Pull Request]:https://help.github.com/articles/using-pull-requests\n[Release v0.6.0 (09.24.2017 / MM.dd.yyyy)]:https://github.com/Naoghuman/lib-database-objectdb/releases/tag/v0.6.0\n[UML]:https://en.wikipedia.org/wiki/Unified_Modeling_Language\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaoghuman%2Flib-database-objectdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaoghuman%2Flib-database-objectdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaoghuman%2Flib-database-objectdb/lists"}