{"id":24482007,"url":"https://github.com/subhashchandra-birajdar/spring-procedure-function","last_synced_at":"2026-04-13T00:05:27.172Z","repository":{"id":273504281,"uuid":"919934087","full_name":"Subhashchandra-Birajdar/spring-procedure-function","owner":"Subhashchandra-Birajdar","description":"stored procedure implemented with database and springboot with gradle. call the procedure and functions.","archived":false,"fork":false,"pushed_at":"2025-01-21T09:34:26.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-28T06:03:06.831Z","etag":null,"topics":["functions","gradle","hibernate-jpa","java17-spring-boot","mysql","open-api","spring","stored-procedures"],"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/Subhashchandra-Birajdar.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":"2025-01-21T09:21:04.000Z","updated_at":"2025-01-21T09:34:30.000Z","dependencies_parsed_at":"2025-01-21T10:39:15.572Z","dependency_job_id":null,"html_url":"https://github.com/Subhashchandra-Birajdar/spring-procedure-function","commit_stats":null,"previous_names":["subhashchandra-birajdar/spring-procedure-function"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Subhashchandra-Birajdar/spring-procedure-function","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Subhashchandra-Birajdar%2Fspring-procedure-function","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Subhashchandra-Birajdar%2Fspring-procedure-function/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Subhashchandra-Birajdar%2Fspring-procedure-function/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Subhashchandra-Birajdar%2Fspring-procedure-function/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Subhashchandra-Birajdar","download_url":"https://codeload.github.com/Subhashchandra-Birajdar/spring-procedure-function/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Subhashchandra-Birajdar%2Fspring-procedure-function/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267470062,"owners_count":24092352,"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-07-28T02:00:09.689Z","response_time":68,"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":["functions","gradle","hibernate-jpa","java17-spring-boot","mysql","open-api","spring","stored-procedures"],"created_at":"2025-01-21T12:12:11.435Z","updated_at":"2025-10-30T16:16:19.579Z","avatar_url":"https://github.com/Subhashchandra-Birajdar.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# spring-procedure-function\n\n![Screenshot 2025-01-18 at 2 40 52 PM](https://github.com/user-attachments/assets/1a7681e6-2077-464a-a706-45c9ec253c23)\n\nupdate_stock:\n--------------\n```\nCREATE DEFINER=`root`@`localhost` PROCEDURE `update_stock`(\nIN productId INT,\nIN quantity INT\n)\nBEGIN\n\tUPDATE product\n    SET stock_quantity = stock_quantity - quantity\n\tWHERE id = productId;\nEND\n```\n\n# call the stored procedure in database level\n```\ncall procedure_function.update_stock(1, 5);\n```\n\nget_total_price:\n----------------\n```\nCREATE DEFINER=`root`@`localhost` FUNCTION `get_total_price`(productId INT) RETURNS decimal(10,2)\n    READS SQL DATA\n    DETERMINISTIC\nBEGIN\n\tDECLARE total DECIMAL(10,2);\n\tSELECT SUM(price*stock_quantity) INTO total\n    FROM Product\n    WHERE id = productId;\n\tRETURN total;\nEND\n```\n# call the function in database level\n```\nselect procedure_function.get_total_price(1);\n```\n\n# swagger GUI\n```\nhttp://localhost:8080/swagger-ui.html\n```\n\n### Why Use Stored Procedures and Functions?\n\nComplex Logic: If you have complicated SQL operations — like multiple joins or conditional logic — stored procedures can help organize your code.\n\nPerformance: Stored procedures sometimes run faster because the database can optimize and cache them.\n\nSecurity: You can permit to run a stored procedure without allowing direct access to the underlying tables.\n\nReusability: If many applications or parts of your code need the same SQL logic, you can store it in a procedure or function and call it whenever you want\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubhashchandra-birajdar%2Fspring-procedure-function","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsubhashchandra-birajdar%2Fspring-procedure-function","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsubhashchandra-birajdar%2Fspring-procedure-function/lists"}