{"id":24738037,"url":"https://github.com/datanucleus/datanucleus-rdbms","last_synced_at":"2025-04-04T16:15:32.483Z","repository":{"id":12402500,"uuid":"15055753","full_name":"datanucleus/datanucleus-rdbms","owner":"datanucleus","description":"DataNucleus support for persistence to RDBMS Datastores","archived":false,"fork":false,"pushed_at":"2024-08-27T04:20:40.000Z","size":13054,"stargazers_count":28,"open_issues_count":28,"forks_count":66,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-08-27T12:38:49.037Z","etag":null,"topics":["jdbc","jdo","jpa","rdbms"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datanucleus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-12-09T18:43:22.000Z","updated_at":"2024-08-27T04:20:43.000Z","dependencies_parsed_at":"2023-12-22T15:50:25.792Z","dependency_job_id":"dc5a9b52-2d4c-49fc-a757-81e0d749052d","html_url":"https://github.com/datanucleus/datanucleus-rdbms","commit_stats":null,"previous_names":[],"tags_count":108,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datanucleus%2Fdatanucleus-rdbms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datanucleus%2Fdatanucleus-rdbms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datanucleus%2Fdatanucleus-rdbms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datanucleus%2Fdatanucleus-rdbms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datanucleus","download_url":"https://codeload.github.com/datanucleus/datanucleus-rdbms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208151,"owners_count":20901570,"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":["jdbc","jdo","jpa","rdbms"],"created_at":"2025-01-27T22:34:57.763Z","updated_at":"2025-04-04T16:15:32.463Z","avatar_url":"https://github.com/datanucleus.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# datanucleus-rdbms\n\nDataNucleus support for persistence to RDBMS Datastores. This plugin makes use of JDBC drivers for the datastores supported. \n\nThis project is built using Maven, by executing `mvn clean install` which installs the built jar in your local Maven repository.\n\n\n## KeyFacts\n\n__License__ : Apache 2 licensed  \n__Issue Tracker__ : http://github.com/datanucleus/datanucleus-rdbms/issues  \n__Javadocs__ : [6.0](http://www.datanucleus.org/javadocs/store.rdbms/6.0/), [5.2](http://www.datanucleus.org/javadocs/store.rdbms/5.2/), [5.1](http://www.datanucleus.org/javadocs/store.rdbms/5.1/), [5.0](http://www.datanucleus.org/javadocs/store.rdbms/5.0/), [4.1](http://www.datanucleus.org/javadocs/store.rdbms/4.1/), [4.0](http://www.datanucleus.org/javadocs/store.rdbms/4.0/)  \n__Download__ : [Maven Central](https://repo1.maven.org/maven2/org/datanucleus/datanucleus-rdbms)  \n__Dependencies__ : See file [pom.xml](pom.xml)  \n__Support__ : [DataNucleus Support Page](http://www.datanucleus.org/support.html)  \n\n\n## Datastore Adapters\n\nEach supported datastore will have an associated \"adapter\" stored under \n[org.datanucleus.store.rdbms.adapter](https://github.com/datanucleus/datanucleus-rdbms/tree/master/src/main/java/org/datanucleus/store/rdbms/adapter), \nso if planning on supporting or improving support for an RDBMS database this is the place to look (as well as in \n[plugin.xml](https://github.com/datanucleus/datanucleus-rdbms/blob/master/src/main/resources/plugin.xml)).\n\n\n## Mappings\n\nDataNucleus RDBMS maps fields to columns using a _mapping_. Each Java type has a JavaTypeMapping variant, under\n[org.datanucleus.store.rdbms.mapping.java](https://github.com/datanucleus/datanucleus-rdbms/tree/master/src/main/java/org/datanucleus/store/rdbms/mapping/java)\nand each of these has 1+ ColumnMapping (which map approximately onto JDBC types), under\n[org.datanucleus.store.rdbms.mapping.column](https://github.com/datanucleus/datanucleus-rdbms/tree/master/src/main/java/org/datanucleus/store/rdbms/mapping/column).\n\nLater DataNucleus releases are making less use of these mappings and more use of the internal _TypeConverter_ mechanism, so that we now only have mappings for\nsome of the more basic types or where complicated handling is required, with remaining types using TypeConverterMapping.\n\n\n## SQL Generation\n\nAll SQL generated by datanucleus-rdbms uses an SQL API, located under \n[org.datanucleus.store.rdbms.sql](https://github.com/datanucleus/datanucleus-rdbms/tree/master/src/main/java/org/datanucleus/store/rdbms/sql).\nThere you have classes representing SELECT, UPDATE, DELETE and INSERT statements, providing an API for building the SQL.\n\n### Table Groups\n\nA __table group__ is a group of tables in the SQL statement. The SQL statement will be composed of 1 or more table groups.\nA table group equates to an object in an object-based query language.\nFor example the candidate object will be in the first table group. When a relation is navigated the related object will be in its table group. \nAnd so on. All of the way down an inheritance tree will use the same table group; by that we mean that if you have a class Person and \nclass Employee which extends Person and they have their own tables in the datastore, then when referring to the candidate object of type Employee, \nthe tables PERSON and EMPLOYEE will be in the same table group.\n\n\n### Table Naming\n\nWith the SQLStatement API a developer can define the aliases of tables in the SQL statement. If they don't define an alias then the aliases will \nbe generated for them using a DataNucleus extension. The plugin-point `org.datanucleus.store.rdbms.sql_tablenamer` defines an interface\nto be implemented by plugins for naming of tables. The default option is __alpha-scheme__.\n\n__alpha-scheme__ will name tables based on the table group they are in and the number of the table within that group. So you will get table \naliases like A0, A1, A2, B0, B1, C0, D0. In this case we have a candidate object in the query with 3 tables (A0, A1, A2) and relations to \nan object with 2 tables (B0, B1) and these have relations to other objects with a single table (C0), (D0).\n\n__t-scheme__ will name tables based on the table number in the statement as a whole and doesn't use the table group for anything. So you get \ntable aliases like T0, T1, T2, T3, T4, T5, etc.\n\n__table-name__ will use the table name instead of an alias. Clearly this will not work if you have joins to the same table name, but is useful\nin situations where, for example, the RDBMS doesn't support aliases in an UPDATE/DELETE statement.\n\n\nTo define which namer plugin you want to use, set the extension __table-naming-strategy__ on the SQLStatement and by the persistence\nproperty __datanucleus.rdbms.sqlTableNamingStrategy__ at construction of the PMF/EMF.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatanucleus%2Fdatanucleus-rdbms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatanucleus%2Fdatanucleus-rdbms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatanucleus%2Fdatanucleus-rdbms/lists"}