{"id":21581546,"url":"https://github.com/thoughtscript/spring_boot_2023","last_synced_at":"2025-07-16T22:30:29.138Z","repository":{"id":156871722,"uuid":"596254710","full_name":"Thoughtscript/spring_boot_2023","owner":"Thoughtscript","description":"Basic Spring Boot practice","archived":false,"fork":false,"pushed_at":"2024-05-07T18:50:10.000Z","size":81,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-07T19:46:23.268Z","etag":null,"topics":["docker","postgres","spring-boot","spring-security"],"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/Thoughtscript.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":"2023-02-01T19:44:33.000Z","updated_at":"2024-05-07T18:50:13.000Z","dependencies_parsed_at":"2024-05-07T19:44:38.486Z","dependency_job_id":"8d0fcb7d-f532-4d1f-9cd0-12e33f514037","html_url":"https://github.com/Thoughtscript/spring_boot_2023","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thoughtscript%2Fspring_boot_2023","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thoughtscript%2Fspring_boot_2023/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thoughtscript%2Fspring_boot_2023/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thoughtscript%2Fspring_boot_2023/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Thoughtscript","download_url":"https://codeload.github.com/Thoughtscript/spring_boot_2023/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226171933,"owners_count":17584910,"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":["docker","postgres","spring-boot","spring-security"],"created_at":"2024-11-24T14:12:53.637Z","updated_at":"2024-11-24T14:12:55.353Z","avatar_url":"https://github.com/Thoughtscript.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Boot 2023\n\n[![](https://img.shields.io/badge/Spring%20Boot-3.0.2-green.svg)](https://spring.io/projects/spring-boot)\n[![](https://img.shields.io/badge/Gradle-7.5.1-darkslategray.svg)](https://gradle.org/)\n[![](https://img.shields.io/badge/Maven-3.8.6-white.svg)](https://maven.apache.org/download.cgi)\n[![](https://img.shields.io/badge/Docker-blue.svg)](https://www.docker.com/) \n[![](https://img.shields.io/badge/Postgres-13.0-lightblue.svg)](https://hub.docker.com/_/postgres)\n\n## Use\n\nMaven:\n```bash\nmvn clean\nmvn install\nmvn spring-boot:run\n```\n\nGradle:\n```bash\n./gradlew clean\n./gradlew build\n./gradlew run\n```\n\nSSL:\n```bash\nkeytool -genkey \\\n  -alias bootexample \\\n  -keystore bootexample.p12 \\\n  -storetype PKCS12 \\\n  -keyalg RSA \\\n  -storepass af3DF*34afefwefehu \\\n  -validity 730 \\\n  -keysize 4096\n```\n\n## API\n\n### Get All Examples\n\nhttps://localhost:8080/api/example/all\n\n```JSON\n[\n    {\n        \"id\": 1,\n        \"name\": \"aa\",\n        \"oneToOneRelation\": {\n            \"id\": 1,\n            \"name\": \"a\"\n        },\n        \"oneToManyRelations\": [\n            {\n                \"id\": 1,\n                \"name\": \"aaa\",\n                \"examplefk\": 1\n            },\n            {\n                \"id\": 2,\n                \"name\": \"bbb\",\n                \"examplefk\": 1\n            }\n        ],\n        \"manyonerelationfk\": 1,\n        \"manyToManyRelations\": [\n            {\n                \"id\": 1,\n                \"name\": \"aaaaa\"\n            },\n            {\n                \"id\": 2,\n                \"name\": \"bbbbb\"\n            }\n        ]\n    },\n    {\n        \"id\": 2,\n        \"name\": \"bb\",\n        \"oneToOneRelation\": {\n            \"id\": 2,\n            \"name\": \"b\"\n        },\n        \"oneToManyRelations\": [\n            {\n                \"id\": 3,\n                \"name\": \"ccc\",\n                \"examplefk\": 2\n            },\n            {\n                \"id\": 4,\n                \"name\": \"ddd\",\n                \"examplefk\": 2\n            }\n        ],\n        \"manyonerelationfk\": 2,\n        \"manyToManyRelations\": []\n    },\n    {\n        \"id\": 3,\n        \"name\": \"cc\",\n        \"oneToOneRelation\": {\n            \"id\": 3,\n            \"name\": \"c\"\n        },\n        \"oneToManyRelations\": [\n            {\n                \"id\": 5,\n                \"name\": \"aaa\",\n                \"examplefk\": 3\n            },\n            {\n                \"id\": 6,\n                \"name\": \"bbb\",\n                \"examplefk\": 3\n            }\n        ],\n        \"manyonerelationfk\": 3,\n        \"manyToManyRelations\": []\n    },\n    {\n        \"id\": 4,\n        \"name\": \"dd\",\n        \"oneToOneRelation\": {\n            \"id\": 4,\n            \"name\": \"d\"\n        },\n        \"oneToManyRelations\": [\n            {\n                \"id\": 7,\n                \"name\": \"ccc\",\n                \"examplefk\": 4\n            },\n            {\n                \"id\": 8,\n                \"name\": \"ddd\",\n                \"examplefk\": 4\n            }\n        ],\n        \"manyonerelationfk\": 4,\n        \"manyToManyRelations\": []\n    },\n    {\n        \"id\": 52,\n        \"name\": \"aa\",\n        \"oneToOneRelation\": {\n            \"id\": 52,\n            \"name\": \"a\"\n        },\n        \"oneToManyRelations\": [\n            {\n                \"id\": 52,\n                \"name\": \"aaa\",\n                \"examplefk\": 52\n            },\n            {\n                \"id\": 53,\n                \"name\": \"bbb\",\n                \"examplefk\": 52\n            }\n        ],\n        \"manyonerelationfk\": 52,\n        \"manyToManyRelations\": [\n            {\n                \"id\": 52,\n                \"name\": \"aaaaa\"\n            },\n            {\n                \"id\": 53,\n                \"name\": \"bbbbb\"\n            }\n        ]\n    },\n    {\n        \"id\": 53,\n        \"name\": \"bb\",\n        \"oneToOneRelation\": {\n            \"id\": 53,\n            \"name\": \"b\"\n        },\n        \"oneToManyRelations\": [\n            {\n                \"id\": 54,\n                \"name\": \"ccc\",\n                \"examplefk\": 53\n            },\n            {\n                \"id\": 55,\n                \"name\": \"ddd\",\n                \"examplefk\": 53\n            }\n        ],\n        \"manyonerelationfk\": 53,\n        \"manyToManyRelations\": []\n    },\n    {\n        \"id\": 54,\n        \"name\": \"cc\",\n        \"oneToOneRelation\": {\n            \"id\": 54,\n            \"name\": \"c\"\n        },\n        \"oneToManyRelations\": [\n            {\n                \"id\": 56,\n                \"name\": \"aaa\",\n                \"examplefk\": 54\n            },\n            {\n                \"id\": 57,\n                \"name\": \"bbb\",\n                \"examplefk\": 54\n            }\n        ],\n        \"manyonerelationfk\": 54,\n        \"manyToManyRelations\": []\n    },\n    {\n        \"id\": 55,\n        \"name\": \"dd\",\n        \"oneToOneRelation\": {\n            \"id\": 55,\n            \"name\": \"d\"\n        },\n        \"oneToManyRelations\": [\n            {\n                \"id\": 58,\n                \"name\": \"ccc\",\n                \"examplefk\": 55\n            },\n            {\n                \"id\": 59,\n                \"name\": \"ddd\",\n                \"examplefk\": 55\n            }\n        ],\n        \"manyonerelationfk\": 55,\n        \"manyToManyRelations\": []\n    }\n]\n```\n\n### Get All Many To Many Relations\n\nhttps://localhost:8080/api/relations/many/many/all\n\nSuppressed `List\u003cExample\u003e` field.\n\n```JSON\n[\n    {\n        \"id\": 1,\n        \"name\": \"aaaaa\"\n    },\n    {\n        \"id\": 2,\n        \"name\": \"bbbbb\"\n    },\n    {\n        \"id\": 3,\n        \"name\": \"ccccc\"\n    },\n    {\n        \"id\": 4,\n        \"name\": \"ddddd\"\n    },\n    {\n        \"id\": 52,\n        \"name\": \"aaaaa\"\n    },\n    {\n        \"id\": 53,\n        \"name\": \"bbbbb\"\n    },\n    {\n        \"id\": 54,\n        \"name\": \"ccccc\"\n    },\n    {\n        \"id\": 55,\n        \"name\": \"ddddd\"\n    }\n]\n```\n\n### Get All One To Many Relations\n\nhttps://localhost:8080/api/relations/one/many/all\n\n```JSON\n[\n    {\n        \"id\": 1,\n        \"name\": \"aaa\",\n        \"examplefk\": 1\n    },\n    {\n        \"id\": 2,\n        \"name\": \"bbb\",\n        \"examplefk\": 1\n    },\n    {\n        \"id\": 3,\n        \"name\": \"ccc\",\n        \"examplefk\": 2\n    },\n    {\n        \"id\": 4,\n        \"name\": \"ddd\",\n        \"examplefk\": 2\n    },\n    {\n        \"id\": 5,\n        \"name\": \"aaa\",\n        \"examplefk\": 3\n    },\n    {\n        \"id\": 6,\n        \"name\": \"bbb\",\n        \"examplefk\": 3\n    },\n    {\n        \"id\": 7,\n        \"name\": \"ccc\",\n        \"examplefk\": 4\n    },\n    {\n        \"id\": 8,\n        \"name\": \"ddd\",\n        \"examplefk\": 4\n    },\n    {\n        \"id\": 52,\n        \"name\": \"aaa\",\n        \"examplefk\": 52\n    },\n    {\n        \"id\": 53,\n        \"name\": \"bbb\",\n        \"examplefk\": 52\n    },\n    {\n        \"id\": 54,\n        \"name\": \"ccc\",\n        \"examplefk\": 53\n    },\n    {\n        \"id\": 55,\n        \"name\": \"ddd\",\n        \"examplefk\": 53\n    },\n    {\n        \"id\": 56,\n        \"name\": \"aaa\",\n        \"examplefk\": 54\n    },\n    {\n        \"id\": 57,\n        \"name\": \"bbb\",\n        \"examplefk\": 54\n    },\n    {\n        \"id\": 58,\n        \"name\": \"ccc\",\n        \"examplefk\": 55\n    },\n    {\n        \"id\": 59,\n        \"name\": \"ddd\",\n        \"examplefk\": 55\n    }\n]\n````\n\n### Get All One To One Relations\n\nhttps://localhost:8080/api/relations/one/one/all\n\n```JSON\n[\n    {\n        \"id\": 1,\n        \"name\": \"a\"\n    },\n    {\n        \"id\": 2,\n        \"name\": \"b\"\n    },\n    {\n        \"id\": 3,\n        \"name\": \"c\"\n    },\n    {\n        \"id\": 4,\n        \"name\": \"d\"\n    },\n    {\n        \"id\": 52,\n        \"name\": \"a\"\n    },\n    {\n        \"id\": 53,\n        \"name\": \"b\"\n    },\n    {\n        \"id\": 54,\n        \"name\": \"c\"\n    },\n    {\n        \"id\": 55,\n        \"name\": \"d\"\n    }\n]\n```\n\n### Get All Many To One Relations\n\nhttps://localhost:8080/api/relations/many/one/all\n\n```JSON\n[\n    {\n        \"id\": 1,\n        \"name\": \"aaaa\",\n        \"example\": {\n            \"id\": 1,\n            \"name\": \"aa\",\n            \"oneToOneRelation\": {\n                \"id\": 1,\n                \"name\": \"a\"\n            },\n            \"oneToManyRelations\": [\n                {\n                    \"id\": 1,\n                    \"name\": \"aaa\",\n                    \"examplefk\": 1\n                },\n                {\n                    \"id\": 2,\n                    \"name\": \"bbb\",\n                    \"examplefk\": 1\n                }\n            ],\n            \"manyonerelationfk\": 1,\n            \"manyToManyRelations\": [\n                {\n                    \"id\": 1,\n                    \"name\": \"aaaaa\"\n                },\n                {\n                    \"id\": 2,\n                    \"name\": \"bbbbb\"\n                }\n            ]\n        }\n    },\n    {\n        \"id\": 2,\n        \"name\": \"bbbb\",\n        \"example\": {\n            \"id\": 2,\n            \"name\": \"bb\",\n            \"oneToOneRelation\": {\n                \"id\": 2,\n                \"name\": \"b\"\n            },\n            \"oneToManyRelations\": [\n                {\n                    \"id\": 3,\n                    \"name\": \"ccc\",\n                    \"examplefk\": 2\n                },\n                {\n                    \"id\": 4,\n                    \"name\": \"ddd\",\n                    \"examplefk\": 2\n                }\n            ],\n            \"manyonerelationfk\": 2,\n            \"manyToManyRelations\": []\n        }\n    },\n    {\n        \"id\": 3,\n        \"name\": \"cccc\",\n        \"example\": {\n            \"id\": 3,\n            \"name\": \"cc\",\n            \"oneToOneRelation\": {\n                \"id\": 3,\n                \"name\": \"c\"\n            },\n            \"oneToManyRelations\": [\n                {\n                    \"id\": 5,\n                    \"name\": \"aaa\",\n                    \"examplefk\": 3\n                },\n                {\n                    \"id\": 6,\n                    \"name\": \"bbb\",\n                    \"examplefk\": 3\n                }\n            ],\n            \"manyonerelationfk\": 3,\n            \"manyToManyRelations\": []\n        }\n    },\n    {\n        \"id\": 4,\n        \"name\": \"dddd\",\n        \"example\": {\n            \"id\": 4,\n            \"name\": \"dd\",\n            \"oneToOneRelation\": {\n                \"id\": 4,\n                \"name\": \"d\"\n            },\n            \"oneToManyRelations\": [\n                {\n                    \"id\": 7,\n                    \"name\": \"ccc\",\n                    \"examplefk\": 4\n                },\n                {\n                    \"id\": 8,\n                    \"name\": \"ddd\",\n                    \"examplefk\": 4\n                }\n            ],\n            \"manyonerelationfk\": 4,\n            \"manyToManyRelations\": []\n        }\n    },\n    {\n        \"id\": 52,\n        \"name\": \"aaaa\",\n        \"example\": {\n            \"id\": 52,\n            \"name\": \"aa\",\n            \"oneToOneRelation\": {\n                \"id\": 52,\n                \"name\": \"a\"\n            },\n            \"oneToManyRelations\": [\n                {\n                    \"id\": 52,\n                    \"name\": \"aaa\",\n                    \"examplefk\": 52\n                },\n                {\n                    \"id\": 53,\n                    \"name\": \"bbb\",\n                    \"examplefk\": 52\n                }\n            ],\n            \"manyonerelationfk\": 52,\n            \"manyToManyRelations\": [\n                {\n                    \"id\": 52,\n                    \"name\": \"aaaaa\"\n                },\n                {\n                    \"id\": 53,\n                    \"name\": \"bbbbb\"\n                }\n            ]\n        }\n    },\n    {\n        \"id\": 53,\n        \"name\": \"bbbb\",\n        \"example\": {\n            \"id\": 53,\n            \"name\": \"bb\",\n            \"oneToOneRelation\": {\n                \"id\": 53,\n                \"name\": \"b\"\n            },\n            \"oneToManyRelations\": [\n                {\n                    \"id\": 54,\n                    \"name\": \"ccc\",\n                    \"examplefk\": 53\n                },\n                {\n                    \"id\": 55,\n                    \"name\": \"ddd\",\n                    \"examplefk\": 53\n                }\n            ],\n            \"manyonerelationfk\": 53,\n            \"manyToManyRelations\": []\n        }\n    },\n    {\n        \"id\": 54,\n        \"name\": \"cccc\",\n        \"example\": {\n            \"id\": 54,\n            \"name\": \"cc\",\n            \"oneToOneRelation\": {\n                \"id\": 54,\n                \"name\": \"c\"\n            },\n            \"oneToManyRelations\": [\n                {\n                    \"id\": 56,\n                    \"name\": \"aaa\",\n                    \"examplefk\": 54\n                },\n                {\n                    \"id\": 57,\n                    \"name\": \"bbb\",\n                    \"examplefk\": 54\n                }\n            ],\n            \"manyonerelationfk\": 54,\n            \"manyToManyRelations\": []\n        }\n    },\n    {\n        \"id\": 55,\n        \"name\": \"dddd\",\n        \"example\": {\n            \"id\": 55,\n            \"name\": \"dd\",\n            \"oneToOneRelation\": {\n                \"id\": 55,\n                \"name\": \"d\"\n            },\n            \"oneToManyRelations\": [\n                {\n                    \"id\": 58,\n                    \"name\": \"ccc\",\n                    \"examplefk\": 55\n                },\n                {\n                    \"id\": 59,\n                    \"name\": \"ddd\",\n                    \"examplefk\": 55\n                }\n            ],\n            \"manyonerelationfk\": 55,\n            \"manyToManyRelations\": []\n        }\n    }\n]\n```\n\n## Resources and Links\n\n1. https://www.codejava.net/frameworks/spring-boot/connect-to-postgresql-database-examples\n2. https://www.baeldung.com/spring-boot-security-autoconfiguration\n3. https://www.baeldung.com/spring-postconstruct-predestroy\n4. https://dev.to/jhonifaber/hibernate-onetoone-onetomany-manytoone-and-manytomany-8ba\n5. https://stackoverflow.com/questions/56424524/getting-infinite-json-response-when-using-many-to-one-mapping-in-spring\n6. https://www.baeldung.com/jackson-bidirectional-relationships-and-infinite-recursion\n7. https://www.baeldung.com/hibernate-one-to-many","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtscript%2Fspring_boot_2023","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoughtscript%2Fspring_boot_2023","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtscript%2Fspring_boot_2023/lists"}