{"id":24021188,"url":"https://github.com/zipcodecore/jpa.entitymanager","last_synced_at":"2025-06-30T06:04:45.873Z","repository":{"id":48033172,"uuid":"177594187","full_name":"ZipCodeCore/JPA.EntityManager","owner":"ZipCodeCore","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-20T20:21:24.000Z","size":7,"stargazers_count":0,"open_issues_count":4,"forks_count":43,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-20T21:25:52.315Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/ZipCodeCore.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}},"created_at":"2019-03-25T13:40:45.000Z","updated_at":"2025-04-20T20:21:28.000Z","dependencies_parsed_at":"2022-08-12T17:10:41.209Z","dependency_job_id":null,"html_url":"https://github.com/ZipCodeCore/JPA.EntityManager","commit_stats":null,"previous_names":["zipcodecore/jpa.entitymanager"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/ZipCodeCore/JPA.EntityManager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FJPA.EntityManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FJPA.EntityManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FJPA.EntityManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FJPA.EntityManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZipCodeCore","download_url":"https://codeload.github.com/ZipCodeCore/JPA.EntityManager/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FJPA.EntityManager/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262720641,"owners_count":23353448,"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":[],"created_at":"2025-01-08T12:39:46.695Z","updated_at":"2025-06-30T06:04:45.849Z","avatar_url":"https://github.com/ZipCodeCore.png","language":null,"readme":"# JPA - CRUD - Entity Service Lab\n\nRequirements\n\n* JDK 1.8\n* SQL database\n\n\n## Part 1: Create Data Model\n\n1. Create a sql database using a RDBMS (MySql)\n2. Create at least 2 tables to represent some relational object data\n\t* The tables should have 3-7 fields that represent the object\n\t* Tables must relate to one another. Examples:\n\t\t* One to Many\n\t\t* Many to Many\n\t\t* One to One\n\t\t* Many to One\n3. Populate the database with records\n\n__example__\n\na _cd_ table may have the fields for:\n\n* id\n* title\n* desc\n* year\n* artist\n* price\n\nan _artist_ table may have the following:\n\n* id\n* first_name\n* last_name\n* instrument\n\nAn _artist-cd_ join table could then be used to create a _many to many_ relationship.\n\n* cd_id\n* artist_id\n\n## Part 2: Add JPA specification and implementation dependencies\n\nUse Maven.com to get the sql-connector-java dependency and jpa/hibernate dependencies. Add these to your pom.xml\n\n## Part 3 Configure JPA\n\nCreate __persistence.xml__ file and save it to _src -\u003e main -\u003e resources -\u003e META-INF_ folder\n\n[More info](https://thoughts-on-java.org/jpa-persistence-xml/)\n\n## Part 4: Create Services\n\nCreate services that are composed of an _EntityManager_ and has an interface for performing CRUD operations for managing _Entities_ with you database.\n\nService(s) should be able to perform at minimum the following:\n\n* findById()\n* findAll()\n* update()\n* create()\n* delete()\n\nUse annotations such as @ManyToMany or @OneToMany to create relations within your Entities.\n\n```\n@Entity\npublic class CD {\n    @Id\n    @GeneratedValue\n    private Long id;\n\n    @OneToMany()\n    private Set\u003cMusician\u003e musicians = new HashSet\u003c\u003e();\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzipcodecore%2Fjpa.entitymanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzipcodecore%2Fjpa.entitymanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzipcodecore%2Fjpa.entitymanager/lists"}