{"id":15042701,"url":"https://github.com/ashokravina/cricket-team-3","last_synced_at":"2026-02-15T02:31:41.438Z","repository":{"id":255538524,"uuid":"852355634","full_name":"ashokravina/Cricket-Team-3","owner":"ashokravina","description":"This project has Restful API's that allows us to manage to cricket data in the database using sprint boot JPA and Hibernate. By performing CRUD (Create, Read, Update, Delete) operations on the cricket data","archived":false,"fork":false,"pushed_at":"2024-09-04T17:33:17.000Z","size":76,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T16:40:23.272Z","etag":null,"topics":["crud-application","deletemapping","getmapping","java-8","jpa-hibernate","postmapping","putmapping","restapi-framework","spring-boot","springframework"],"latest_commit_sha":null,"homepage":"","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/ashokravina.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":"2024-09-04T17:02:28.000Z","updated_at":"2024-09-04T17:35:47.000Z","dependencies_parsed_at":"2024-09-06T00:48:37.457Z","dependency_job_id":"6c1f2666-5e57-4386-a395-b69098c033d2","html_url":"https://github.com/ashokravina/Cricket-Team-3","commit_stats":null,"previous_names":["ashokravina/cricket-team-3"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ashokravina/Cricket-Team-3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashokravina%2FCricket-Team-3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashokravina%2FCricket-Team-3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashokravina%2FCricket-Team-3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashokravina%2FCricket-Team-3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashokravina","download_url":"https://codeload.github.com/ashokravina/Cricket-Team-3/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashokravina%2FCricket-Team-3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278846396,"owners_count":26056099,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["crud-application","deletemapping","getmapping","java-8","jpa-hibernate","postmapping","putmapping","restapi-framework","spring-boot","springframework"],"created_at":"2024-09-24T20:47:46.405Z","updated_at":"2025-10-07T21:03:48.042Z","avatar_url":"https://github.com/ashokravina.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Given five files,\n\n- `PlayerController.java`\n- `PlayerRepository.java`\n- `PlayerJpaService.java`\n- `PlayerJpaRepository.java`\n- `Player.java`\n\nAnd also given a database file `cricketteam` which contains `TEAM` table.\n\n#### TEAM Table\n\n|   Columns    |  Type   |\n| :----------: | :-----: |\n|   playerId   | INTEGER |\n|  playerName  |  TEXT   |\n| jerseyNumber | INTEGER |\n|     role     |  TEXT   |\n\n\u003cMultiLineNote\u003e\n\nUse only `team` as the table name in both query writing and in the model class within your code.\n\n\u003c/MultiLineNote\u003e\n\n### Completion Instructions\n\n- `Player.java`: The `Player` class should contain the following attributes.\n\n    |  Attribute   |  Type  |\n    | :----------: | :----: |\n    |   playerId   |  int   |\n    |  playerName  | String |\n    | jerseyNumber |  int   |\n    |     role     | String |\n\n- `PlayerRepository.java`: Create an `interface` containing the required methods.\n- `PlayerJpaService.java`: Update the service class with logic for managing player data.\n- `PlayerController.java`: Create the controller class to handle HTTP requests.\n- `PlayerJpaRepository.java`: Create an interface that implements the `JpaRepository` interface.\n  \n\nImplement the following APIs.\n\n### API 1\n\n#### Path: `/players`\n\n#### Method: `GET`\n\n#### Description:\n\nReturns a list of all players in the `team`.\n\n#### Response\n\n```\n[\n    {\n        \"playerId\": 1,\n        \"playerName\": \"Alexander\",\n        \"jerseyNumber\": 5,\n        \"role\": \"All-rounder\"\n    },\n   ...\n]\n```\n\n### API 2\n\n#### Path: `/players`\n\n#### Method: `POST`\n\n#### Description:\n\nCreates a new player in the `team`. The `playerId` is auto-incremented.\n\n#### Request\n\n```\n{\n  \"playerName\": \"Prince\",\n  \"jerseyNumber\": 24,\n  \"role\": \"Bowler\"\n}\n```\n\n#### Response\n\n```\n{\n    \"playerId\": 12,\n    \"playerName\": \"Prince\",\n    \"jerseyNumber\": 24,\n    \"role\": \"Bowler\"\n}\n```\n\n### API 3\n\n#### Path: `/players/{playerId}`\n\n#### Method: `GET`\n\n#### Description:\n\nReturns a player based on the `playerId`. If the given `playerId` is not found in the `team`, raise `ResponseStatusException` with `HttpStatus.NOT_FOUND`.\n\n\n#### Success Response\n\n```\n{\n    \"playerId\": 1,\n    \"playerName\": \"Alexander\",\n    \"jerseyNumber\": 5,\n    \"role\": \"All-rounder\"\n}\n```\n\n### API 4\n\n#### Path: `/players/{playerId}`\n\n#### Method: `PUT`\n\n#### Description:\n\nUpdates the details of a player in the team based on the `playerId` and returns the updated player details.\nIf the given `playerId` is not found in the `team`, raise `ResponseStatusException` with `HttpStatus.NOT_FOUND`.\n\n#### Request\n\n```\n{\n    \"playerName\": \"Yuvi\"\n    \"jerseyNumber\": 12,\n    \"role\": \"All-rounder\"\n}\n```\n\n#### Success Response\n\n```\n{\n    \"playerId\": 3,\n    \"playerName\": \"Yuvi\",\n    \"jerseyNumber\": 12,\n    \"role\": \"All-rounder\"\n}\n```\n\n### API 5\n\n#### Path: `/players/{playerId}`\n\n#### Method: `DELETE`\n\n#### Description:\n\nDeletes a player from the team  based on the `playerId`.\nIf the given `playerId` is not found in the `team`, raise `ResponseStatusException` with `HttpStatus.NOT_FOUND`. \n\n\n**Do not modify the code in `PlayerApplication.java`**\n\n**Do not  modify anything in the `application.properties` file**\n\n**Do not add any SQL files**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashokravina%2Fcricket-team-3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashokravina%2Fcricket-team-3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashokravina%2Fcricket-team-3/lists"}