{"id":19345962,"url":"https://github.com/tolitius/money-making-project","last_synced_at":"2025-04-23T04:36:38.304Z","repository":{"id":1088874,"uuid":"941219","full_name":"tolitius/money-making-project","owner":"tolitius","description":"A project based on Spring and Hibernate that makes money","archived":false,"fork":false,"pushed_at":"2022-02-09T23:23:07.000Z","size":30,"stargazers_count":17,"open_issues_count":4,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T08:23:16.864Z","etag":null,"topics":["hibernate","spring"],"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/tolitius.png","metadata":{"files":{"readme":"README.markdown","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":"2010-09-26T22:31:16.000Z","updated_at":"2024-07-19T11:49:31.000Z","dependencies_parsed_at":"2022-07-06T06:31:29.179Z","dependency_job_id":null,"html_url":"https://github.com/tolitius/money-making-project","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/tolitius%2Fmoney-making-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolitius%2Fmoney-making-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolitius%2Fmoney-making-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tolitius%2Fmoney-making-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tolitius","download_url":"https://codeload.github.com/tolitius/money-making-project/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250372516,"owners_count":21419719,"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":["hibernate","spring"],"created_at":"2024-11-10T04:08:33.261Z","updated_at":"2025-04-23T04:36:37.947Z","avatar_url":"https://github.com/tolitius.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e \u003cem\u003e\u003csub\u003ewhile this project is many years old, and only runs with a pre 11 Java, the principles still apply\u003c/sub\u003e\u003c/em\u003e\n\n## What is \"Money Making Project\"? ##\n\nA very simple example on how to use Spring and Hibernate together\n\n## Who would need such an example? ##\n\nThere are plenty of good examples from Spring and Hibernate themselves. This one is aimed to bring the two together mostly for people who \"heard\" things about the two, read about it, but having a \"practical difficulty\" to combine them.\n\n## What's with a title!?\n\nWell, if you take a look at APIs, you'll see a \"MoneyMakingBusinessService\" with a \"makeMoney\" method. So technically, each time you run \"CleverMoneyMakingBusinessServiceIntegrationTest\", you'd be making some money.\n\nAnd, of course, if you master Spring \u0026 Hibernate, and find yourself a gig, you'll be making even more.\n\n## What's inside\n\nSpring and Hibernate based project that demos simple things such as:\n\n### A way to structure a project\n\nMaven based structure ( hence can be easily used by gradle ). Configuration and property files organized under \"META-INF/conf\", \"META-INF/props\", etc..\n\n### A way to separate Spring configs\n\n\"tx-spring-config.xml\", \"persistence-spring-config.xml\", \"service-spring-config.xml\", \"repository-spring-config.xml\" and \"application-context.xml\" that includes them all\n\n### Properties via PropertyPlaceholderConfigurer\n\n    \u003ccontext:property-placeholder location=\"classpath:META-INF/props/env.properties\"/\u003e\n\n### Hibernate overall configuration file\n\nThat is injected into AnnotationSessionFactoryBean\n\n### Hibernate Named Queries\n\nThat are linked to the Hibernate overall config ( \u0026lt;mapping resource=\"META-INF/conf/hibernate/mapping/startup-bank-named-queries.xml\"/\u0026gt; )\n\n### Spring's DAO / Hibernate Exception Translation\n\nVia @Repository and \"PersistenceExceptionTranslationPostProcessor\"\n\n### Simple CRUD Repository\n\n\tpublic interface MoneyRepository {\n\n\t\tpublic void make( MoneyRoll moneyRoll );       // C\n\t\tpublic MoneyRoll find( Long id );              // R\n\t\tpublic void update( MoneyRoll moneyRoll );     // U\n\t\tpublic void takeOut( MoneyRoll moneyRoll );    // D\n\t}\n\nwith a Hibernate based implementation\n\n### Transaction Management with Spring AOP\n\nDeclarative, on a Service Level, using \"aop:config\", \"tx:advice\" namespaces \n\n### Spring Testing\n\nWith SpringJUnit4ClassRunner, ContextConfiguration, etc..\n\n### Using Embeded in-memory H2 Database for Testing\n\n    \u003cjdbc:embedded-database id=\"dataSource\" type=\"H2\"/\u003e\n\n### Hibernate Logging\n\nMost useful hibernate \"log4j.logger\" properties\n\n### Demoing how important Transaction is for Hibernate Sessions\n\n\"HibernateSessionNotBoundToThreadIntegrationTest\" for the second (after LazyInitializationException ) most common Hibernate exception: \"No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here\"\n\n\n###### _TODO: provide some JPA examples, although, it most likely deserves a separate project to keep things simple_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftolitius%2Fmoney-making-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftolitius%2Fmoney-making-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftolitius%2Fmoney-making-project/lists"}