├── mongodb-hello ├── .gitignore ├── src │ ├── main │ │ ├── resources │ │ │ ├── log4j.properties │ │ │ └── META-INF │ │ │ │ └── spring │ │ │ │ ├── bootstrap.xml │ │ │ │ └── applicationContext.xml │ │ └── java │ │ │ └── org │ │ │ └── springframework │ │ │ └── data │ │ │ └── mongodb │ │ │ └── examples │ │ │ └── hello │ │ │ ├── App.java │ │ │ ├── HelloMongo.java │ │ │ ├── AppConfig.java │ │ │ └── domain │ │ │ ├── Account.java │ │ │ └── Person.java │ └── test │ │ └── resources │ │ └── org │ │ └── springframework │ │ └── data │ │ └── mongodb │ │ └── examples │ │ └── hello │ │ └── SimpleMongoTest-context.xml └── README.txt ├── couchdb-myrestaurants ├── .gitignore └── src │ └── main │ ├── webapp │ ├── WEB-INF │ │ ├── classes │ │ │ ├── alt.properties │ │ │ └── standard.properties │ │ ├── views │ │ │ ├── index-template.jspx │ │ │ ├── header.jspx │ │ │ ├── index.jspx │ │ │ ├── restaurants │ │ │ │ ├── update.jspx │ │ │ │ ├── views.xml │ │ │ │ ├── show.jspx │ │ │ │ ├── list.jspx │ │ │ │ └── create.jspx │ │ │ ├── useraccounts │ │ │ │ ├── views.xml │ │ │ │ ├── update.jspx │ │ │ │ ├── list.jspx │ │ │ │ ├── create.jspx │ │ │ │ └── show.jspx │ │ │ ├── views.xml │ │ │ ├── resourceNotFound.jspx │ │ │ ├── uncaughtException.jspx │ │ │ ├── dataAccessFailure.jspx │ │ │ ├── footer.jspx │ │ │ └── menu.jspx │ │ ├── tags │ │ │ ├── util │ │ │ │ ├── placeholder.tagx │ │ │ │ ├── load-scripts.tagx │ │ │ │ ├── theme.tagx │ │ │ │ ├── language.tagx │ │ │ │ └── panel.tagx │ │ │ ├── menu │ │ │ │ ├── menu.tagx │ │ │ │ ├── category.tagx │ │ │ │ └── item.tagx │ │ │ └── form │ │ │ │ └── dependency.tagx │ │ ├── layouts │ │ │ ├── layouts.xml │ │ │ └── default.jspx │ │ └── i18n │ │ │ └── application.properties │ ├── META-INF │ │ └── MANIFEST.MF │ └── images │ │ ├── add.png │ │ ├── en.png │ │ ├── create.png │ │ ├── delete.png │ │ ├── list.png │ │ ├── show.png │ │ ├── update.png │ │ ├── fav-del.png │ │ ├── fav-new.png │ │ ├── favicon.ico │ │ ├── spring-logo.png │ │ ├── banner-graphic.png │ │ ├── resultset_first.png │ │ ├── resultset_last.png │ │ ├── resultset_next.png │ │ ├── resultset_previous.png │ │ └── springsource-logo.png │ ├── resources │ ├── META-INF │ │ ├── spring │ │ │ └── database.properties │ │ ├── persistence.xml │ │ └── applicationContext-security.xml │ ├── schema.sql │ └── log4j.properties │ ├── java │ └── com │ │ └── springone │ │ └── myrestaurants │ │ ├── dao │ │ ├── Utils.java │ │ ├── JpaRestaurantDao.java │ │ └── JpaUserAccountDao.java │ │ └── config │ │ └── CouchDbConfig.java │ └── test │ └── java │ └── com │ └── springone │ └── myrestaurants │ └── dao │ └── RestaurantDaoTests.java ├── mongodb-myrestaurants-analytics ├── .gitignore ├── src │ └── main │ │ ├── webapp │ │ ├── WEB-INF │ │ │ ├── classes │ │ │ │ ├── alt.properties │ │ │ │ └── standard.properties │ │ │ ├── views │ │ │ │ ├── index-template.jspx │ │ │ │ ├── header.jspx │ │ │ │ ├── index.jspx │ │ │ │ ├── restaurants │ │ │ │ │ ├── update.jspx │ │ │ │ │ ├── views.xml │ │ │ │ │ ├── show.jspx │ │ │ │ │ ├── list.jspx │ │ │ │ │ └── create.jspx │ │ │ │ ├── useraccounts │ │ │ │ │ ├── views.xml │ │ │ │ │ ├── update.jspx │ │ │ │ │ ├── list.jspx │ │ │ │ │ ├── create.jspx │ │ │ │ │ └── show.jspx │ │ │ │ ├── views.xml │ │ │ │ ├── resourceNotFound.jspx │ │ │ │ ├── uncaughtException.jspx │ │ │ │ ├── dataAccessFailure.jspx │ │ │ │ ├── footer.jspx │ │ │ │ └── menu.jspx │ │ │ ├── tags │ │ │ │ ├── util │ │ │ │ │ ├── placeholder.tagx │ │ │ │ │ ├── load-scripts.tagx │ │ │ │ │ ├── theme.tagx │ │ │ │ │ ├── language.tagx │ │ │ │ │ └── panel.tagx │ │ │ │ ├── menu │ │ │ │ │ ├── menu.tagx │ │ │ │ │ ├── category.tagx │ │ │ │ │ └── item.tagx │ │ │ │ └── form │ │ │ │ │ └── dependency.tagx │ │ │ ├── layouts │ │ │ │ ├── layouts.xml │ │ │ │ └── default.jspx │ │ │ └── i18n │ │ │ │ └── application.properties │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ └── images │ │ │ ├── add.png │ │ │ ├── en.png │ │ │ ├── Thumbs.db │ │ │ ├── create.png │ │ │ ├── delete.png │ │ │ ├── list.png │ │ │ ├── show.png │ │ │ ├── update.png │ │ │ ├── fav-del.png │ │ │ ├── fav-new.png │ │ │ ├── favicon.ico │ │ │ ├── spring-logo.png │ │ │ ├── banner-graphic.png │ │ │ ├── resultset_first.png │ │ │ ├── resultset_last.png │ │ │ ├── resultset_next.png │ │ │ ├── resultset_previous.png │ │ │ └── springsource-logo.png │ │ ├── resources │ │ ├── META-INF │ │ │ ├── spring │ │ │ │ ├── database.properties │ │ │ │ └── applicationContext-security.xml │ │ │ └── persistence.xml │ │ ├── schema.sql │ │ └── log4j.properties │ │ └── java │ │ ├── org │ │ └── springframework │ │ │ └── data │ │ │ └── document │ │ │ ├── analytics │ │ │ ├── Parameters.java │ │ │ ├── ControllerCounter.java │ │ │ └── MvcEvent.java │ │ │ └── web │ │ │ └── servlet │ │ │ ├── ActionInterceptor.java │ │ │ └── ActionExecutedContext.java │ │ └── com │ │ └── springone │ │ └── myrestaurants │ │ ├── config │ │ └── MongoConfiguration.java │ │ ├── dao │ │ ├── RestaurantDao.java │ │ └── UserAccountDao.java │ │ └── domain │ │ └── Restaurant.java └── Shortcut to myrestaurants-analytics.lnk ├── .gitignore ├── couchdb-myrestaurants-android ├── res │ ├── drawable │ │ ├── Thumbs.db │ │ ├── profile.jpg │ │ ├── spring09_logo.png │ │ ├── gh_header_logo.png │ │ ├── ic_tab_info_selected.png │ │ ├── ic_tab_events_selected.png │ │ ├── ic_tab_info_unselected.png │ │ ├── ic_tab_profile_selected.png │ │ ├── ic_tab_events_unselected.png │ │ ├── ic_tab_profile_unselected.png │ │ ├── ic_menu_close_clear_cancel.png │ │ ├── ic_tab_events.xml │ │ ├── ic_tab_info.xml │ │ └── ic_tab_profile.xml │ ├── drawable-hdpi │ │ └── icon.png │ ├── drawable-ldpi │ │ └── icon.png │ ├── drawable-mdpi │ │ └── icon.png │ ├── layout │ │ ├── menu_list_item.xml │ │ ├── rests_list_item.xml │ │ ├── main.xml │ │ ├── event_details.xml │ │ ├── signin.xml │ │ └── remove_event_details.xml │ └── values │ │ └── strings.xml ├── lib │ ├── slf4j-android-1.6.1-RC1.jar │ ├── jackson-core-asl-1.7.0-SNAPSHOT.jar │ └── jackson-mapper-asl-1.7.0-SNAPSHOT.jar ├── src │ ├── org │ │ └── springframework │ │ │ ├── core │ │ │ ├── io │ │ │ │ └── package-info.java │ │ │ └── NestedExceptionUtils.java │ │ │ ├── web │ │ │ ├── util │ │ │ │ └── package-info.java │ │ │ ├── client │ │ │ │ ├── package-info.java │ │ │ │ ├── ResourceAccessException.java │ │ │ │ ├── RestClientException.java │ │ │ │ ├── HttpClientErrorException.java │ │ │ │ ├── HttpServerErrorException.java │ │ │ │ ├── RequestCallback.java │ │ │ │ ├── ResponseExtractor.java │ │ │ │ ├── ResponseErrorHandler.java │ │ │ │ └── HttpStatusCodeException.java │ │ │ └── RestTemplateActivity.java │ │ │ ├── http │ │ │ ├── converter │ │ │ │ ├── json │ │ │ │ │ └── package-info.java │ │ │ │ ├── package-info.java │ │ │ │ ├── HttpMessageConversionException.java │ │ │ │ ├── HttpMessageNotReadableException.java │ │ │ │ └── HttpMessageNotWritableException.java │ │ │ ├── HttpMethod.java │ │ │ ├── HttpMessage.java │ │ │ ├── HttpInputMessage.java │ │ │ ├── HttpOutputMessage.java │ │ │ └── client │ │ │ │ ├── ClientHttpRequestFactory.java │ │ │ │ ├── ClientHttpResponse.java │ │ │ │ └── ClientHttpRequest.java │ │ │ └── util │ │ │ └── MultiValueMap.java │ └── com │ │ └── springsource │ │ └── myrestaurants │ │ ├── config │ │ └── CouchDbConfig.java │ │ ├── controllers │ │ └── NavigationManager.java │ │ ├── activities │ │ ├── InfoActivity.java │ │ └── MainTabWidget.java │ │ └── MainActivity.java ├── default.properties └── AndroidManifest.xml ├── README.md ├── mongodb-music └── src │ ├── main │ ├── resources │ │ └── log4j.properties │ └── java │ │ └── org │ │ └── springframework │ │ └── data │ │ └── mongodb │ │ └── examples │ │ └── music │ │ ├── AlbumRepository.java │ │ ├── Stars.java │ │ └── Track.java │ └── test │ ├── resources │ └── org │ │ └── springframework │ │ └── data │ │ └── mongodb │ │ └── examples │ │ └── music │ │ ├── AbstractIntegrationTest-context.xml │ │ ├── AlbumRepositoryIntegrationTest-context.xml │ │ └── QueryDslIntegrationTests-context.xml │ └── java │ └── org │ └── springframework │ └── data │ └── mongodb │ └── examples │ └── music │ ├── QueryDslIntegrationTests.java │ └── AlbumRepositoryIntegrationTest.java └── mongodb-customer-service-data └── src └── main ├── java └── org │ └── springframework │ └── data │ └── mongodb │ └── examples │ └── custsvc │ ├── data │ └── CustomerRepository.java │ └── domain │ ├── SurveyInfo.java │ └── Customer.java └── resources ├── log4j.properties └── META-INF └── persistence.xml /mongodb-hello/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | .settings/ 3 | .classpath 4 | .project 5 | .springBeans 6 | *.i* -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/classes/alt.properties: -------------------------------------------------------------------------------- 1 | styleSheet=resources/styles/alt.css 2 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/classes/standard.properties: -------------------------------------------------------------------------------- 1 | styleSheet=resources/styles/standard.css 2 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/classes/alt.properties: -------------------------------------------------------------------------------- 1 | styleSheet=resources/styles/alt.css 2 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/classes/standard.properties: -------------------------------------------------------------------------------- 1 | styleSheet=resources/styles/standard.css 2 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/drawable/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants-android/res/drawable/Thumbs.db -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants/src/main/webapp/images/add.png -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/images/en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants/src/main/webapp/images/en.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # spring-data-document-examples is no longer actively maintained by VMware, Inc. 2 | 3 | # spring-data-document-examples 4 | Examples using Spring Data Document features 5 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/drawable/profile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants-android/res/drawable/profile.jpg -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/images/create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants/src/main/webapp/images/create.png -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/images/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants/src/main/webapp/images/delete.png -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/images/list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants/src/main/webapp/images/list.png -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/images/show.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants/src/main/webapp/images/show.png -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/images/update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants/src/main/webapp/images/update.png -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants-android/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants-android/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants-android/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/images/fav-del.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants/src/main/webapp/images/fav-del.png -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/images/fav-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants/src/main/webapp/images/fav-new.png -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants/src/main/webapp/images/favicon.ico -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/drawable/spring09_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants-android/res/drawable/spring09_logo.png -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/images/spring-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants/src/main/webapp/images/spring-logo.png -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/lib/slf4j-android-1.6.1-RC1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants-android/lib/slf4j-android-1.6.1-RC1.jar -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/drawable/gh_header_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants-android/res/drawable/gh_header_logo.png -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/mongodb-myrestaurants-analytics/src/main/webapp/images/add.png -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/images/en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/mongodb-myrestaurants-analytics/src/main/webapp/images/en.png -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/images/banner-graphic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants/src/main/webapp/images/banner-graphic.png -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/images/resultset_first.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants/src/main/webapp/images/resultset_first.png -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/images/resultset_last.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants/src/main/webapp/images/resultset_last.png -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/images/resultset_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants/src/main/webapp/images/resultset_next.png -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/images/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/mongodb-myrestaurants-analytics/src/main/webapp/images/Thumbs.db -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/images/create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/mongodb-myrestaurants-analytics/src/main/webapp/images/create.png -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/images/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/mongodb-myrestaurants-analytics/src/main/webapp/images/delete.png -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/images/list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/mongodb-myrestaurants-analytics/src/main/webapp/images/list.png -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/images/show.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/mongodb-myrestaurants-analytics/src/main/webapp/images/show.png -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/images/update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/mongodb-myrestaurants-analytics/src/main/webapp/images/update.png -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/drawable/ic_tab_info_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants-android/res/drawable/ic_tab_info_selected.png -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/images/resultset_previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants/src/main/webapp/images/resultset_previous.png -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/images/springsource-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants/src/main/webapp/images/springsource-logo.png -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/images/fav-del.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/mongodb-myrestaurants-analytics/src/main/webapp/images/fav-del.png -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/images/fav-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/mongodb-myrestaurants-analytics/src/main/webapp/images/fav-new.png -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/mongodb-myrestaurants-analytics/src/main/webapp/images/favicon.ico -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/lib/jackson-core-asl-1.7.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants-android/lib/jackson-core-asl-1.7.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/drawable/ic_tab_events_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants-android/res/drawable/ic_tab_events_selected.png -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/drawable/ic_tab_info_unselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants-android/res/drawable/ic_tab_info_unselected.png -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/drawable/ic_tab_profile_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants-android/res/drawable/ic_tab_profile_selected.png -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/images/spring-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/mongodb-myrestaurants-analytics/src/main/webapp/images/spring-logo.png -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/lib/jackson-mapper-asl-1.7.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants-android/lib/jackson-mapper-asl-1.7.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/drawable/ic_tab_events_unselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants-android/res/drawable/ic_tab_events_unselected.png -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/drawable/ic_tab_profile_unselected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants-android/res/drawable/ic_tab_profile_unselected.png -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/Shortcut to myrestaurants-analytics.lnk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/mongodb-myrestaurants-analytics/Shortcut to myrestaurants-analytics.lnk -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/drawable/ic_menu_close_clear_cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/couchdb-myrestaurants-android/res/drawable/ic_menu_close_clear_cancel.png -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/resources/META-INF/spring/database.properties: -------------------------------------------------------------------------------- 1 | database.driverClassName=org.hsqldb.jdbcDriver 2 | database.url=jdbc:hsqldb:hsql://localhost:9001 3 | database.username=sa 4 | database.password= 5 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/images/banner-graphic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/mongodb-myrestaurants-analytics/src/main/webapp/images/banner-graphic.png -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/images/resultset_first.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/mongodb-myrestaurants-analytics/src/main/webapp/images/resultset_first.png -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/images/resultset_last.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/mongodb-myrestaurants-analytics/src/main/webapp/images/resultset_last.png -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/images/resultset_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/mongodb-myrestaurants-analytics/src/main/webapp/images/resultset_next.png -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/images/resultset_previous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/mongodb-myrestaurants-analytics/src/main/webapp/images/resultset_previous.png -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/images/springsource-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-attic/spring-data-document-examples/HEAD/mongodb-myrestaurants-analytics/src/main/webapp/images/springsource-logo.png -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/resources/META-INF/spring/database.properties: -------------------------------------------------------------------------------- 1 | database.driverClassName=org.hsqldb.jdbcDriver 2 | database.url=jdbc:hsqldb:hsql://localhost:9001 3 | database.username=sa 4 | database.password= 5 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/src/org/springframework/core/io/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * 4 | * Generic abstraction for (file-based) resources, used throughout the framework. 5 | * 6 | */ 7 | package org.springframework.core.io; 8 | 9 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/src/org/springframework/web/util/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * 4 | * Miscellaneous web utility classes, such as HTML escaping, 5 | * log4j initialization, and cookie handling. 6 | * 7 | */ 8 | package org.springframework.web.util; 9 | 10 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE restaurant ( 2 | id BIGINT IDENTITY PRIMARY KEY, 3 | name VARCHAR(255), 4 | version BIGINT, 5 | zip_code VARCHAR(255), 6 | city VARCHAR(255), 7 | state VARCHAR(255) 8 | ); -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/src/org/springframework/web/client/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * 4 | * Core package of the client-side web support. 5 | * Provides a RestTemplate class and various callback interfaces. 6 | * 7 | */ 8 | package org.springframework.web.client; 9 | 10 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE restaurant ( 2 | id BIGINT IDENTITY PRIMARY KEY, 3 | name VARCHAR(255), 4 | version BIGINT, 5 | zip_code VARCHAR(255), 6 | city VARCHAR(255), 7 | state VARCHAR(255) 8 | ); -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/src/com/springsource/myrestaurants/config/CouchDbConfig.java: -------------------------------------------------------------------------------- 1 | package com.springsource.myrestaurants.config; 2 | 3 | 4 | public class CouchDbConfig { 5 | 6 | public static String URL = "http://127.0.0.1:5984/spring_demo_android/"; 7 | 8 | 9 | 10 | } 11 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/layout/menu_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/drawable/ic_tab_events.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/drawable/ic_tab_info.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/drawable/ic_tab_profile.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /mongodb-hello/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=INFO, stdout 2 | 3 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n 6 | 7 | log4j.category.org.springframework=INFO 8 | log4j.category.org.springframework.data=INFO 9 | -------------------------------------------------------------------------------- /mongodb-music/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=INFO, stdout 2 | 3 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %40.40c:%4L - %m%n 6 | 7 | log4j.category.org.springframework=INFO 8 | log4j.category.org.springframework.data=DEBUG 9 | -------------------------------------------------------------------------------- /mongodb-customer-service-data/src/main/java/org/springframework/data/mongodb/examples/custsvc/data/CustomerRepository.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.examples.custsvc.data; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.mongodb.examples.custsvc.domain.Customer; 5 | 6 | public interface CustomerRepository extends JpaRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/default.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "build.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | -------------------------------------------------------------------------------- /mongodb-customer-service-data/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=INFO, stdout 2 | 3 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %40.40c:%4L - %m%n 6 | 7 | log4j.category.org.springframework=INFO 8 | log4j.category.org.hibernate.SQL=DEBUG 9 | log4j.category.org.springframework.data=DEBUG 10 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/views/index-template.jspx: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 |

7 | 8 |

9 |
10 |
-------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/views/index-template.jspx: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 |

7 | 8 |

9 |
10 |
-------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/layout/rests_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/tags/util/placeholder.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/tags/util/placeholder.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/src/com/springsource/myrestaurants/controllers/NavigationManager.java: -------------------------------------------------------------------------------- 1 | package com.springsource.myrestaurants.controllers; 2 | 3 | import java.util.concurrent.RejectedExecutionException; 4 | 5 | import android.content.Context; 6 | import android.content.Intent; 7 | 8 | public class NavigationManager { 9 | 10 | public static boolean startActivity(Context context, Class activity) { 11 | try { 12 | Intent intent = new Intent(); 13 | intent.setClass(context, activity); 14 | context.startActivity(intent); 15 | } catch (RejectedExecutionException ex) { } 16 | 17 | return true; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/views/header.jspx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/views/index.jspx: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 |

7 | 8 |

9 |

10 | 11 |

12 |
13 |
-------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/views/header.jspx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/views/index.jspx: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 |

7 | 8 |

9 |

10 | 11 |

12 |
13 |
-------------------------------------------------------------------------------- /mongodb-hello/README.txt: -------------------------------------------------------------------------------- 1 | Start your MongoDB instance. For a MongoDB guide see https://www.mongodb.org/display/DOCS/Quickstart 2 | Your MongoDB instance should be listening on the default port. 3 | 4 | From the commandline run: 5 | mvn exec:java 6 | 7 | You should see some output resembling this: 8 | 9 | Results: [Person [id=4de7c19bab45985f76ebe650, name=John, age=39, accounts=[Account [id=null, accountNumber=1234-59873-893-1, accountType=SAVINGS, balance=123.45]]]] 10 | DONE! 11 | [INFO] ------------------------------------------------------------------------ 12 | [INFO] BUILD SUCCESSFUL 13 | [INFO] ------------------------------------------------------------------------ 14 | 15 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/src/com/springsource/myrestaurants/activities/InfoActivity.java: -------------------------------------------------------------------------------- 1 | package com.springsource.myrestaurants.activities; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.widget.TextView; 6 | 7 | public class InfoActivity extends Activity { 8 | 9 | //*************************************** 10 | // Activity methods 11 | //*************************************** 12 | @Override 13 | public void onCreate(Bundle savedInstanceState) { 14 | super.onCreate(savedInstanceState); 15 | 16 | TextView textview = new TextView(this); 17 | textview.setText("SpringOne CouchDB Demo version 0.1"); 18 | setContentView(textview); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /mongodb-customer-service-data/src/main/java/org/springframework/data/mongodb/examples/custsvc/domain/SurveyInfo.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.examples.custsvc.domain; 2 | 3 | import java.util.Map; 4 | 5 | public class SurveyInfo { 6 | 7 | private Map questionsAndAnswers; 8 | 9 | public Map getQuestionsAndAnswers() { 10 | return questionsAndAnswers; 11 | } 12 | 13 | public void setQuestionsAndAnswers(Map questionsAndAnswers) { 14 | this.questionsAndAnswers = questionsAndAnswers; 15 | } 16 | 17 | @Override 18 | public String toString() { 19 | return "SurveyInfo [questionsAndAnswers=" + questionsAndAnswers + "]"; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/java/com/springone/myrestaurants/dao/Utils.java: -------------------------------------------------------------------------------- 1 | package com.springone.myrestaurants.dao; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class Utils { 7 | 8 | 9 | public static List convertToList(int[] favorites) { 10 | List list = new ArrayList(favorites.length); 11 | for (int i = 0; i < favorites.length; i++) { 12 | list.add(favorites[i]); 13 | } 14 | return list; 15 | } 16 | 17 | public static int[] convertToPrimArray(List list) { 18 | int[] array = new int[list.size()]; 19 | for (int i = 0; i < list.size(); i++) { 20 | array[i] = list.get(i); 21 | } 22 | return array; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=error, stdout 2 | 3 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | 6 | # Print the date in ISO 8601 format 7 | log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n 8 | 9 | log4j.appender.R=org.apache.log4j.RollingFileAppender 10 | log4j.appender.R.File=application.log 11 | 12 | log4j.appender.R.MaxFileSize=100KB 13 | # Keep one backup file 14 | log4j.appender.R.MaxBackupIndex=1 15 | 16 | log4j.appender.R.layout=org.apache.log4j.PatternLayout 17 | log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n 18 | 19 | log4j.category.org.springframework.jdbc=INFO 20 | 21 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/java/org/springframework/data/document/analytics/Parameters.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.document.analytics; 2 | 3 | public class Parameters { 4 | 5 | private String p1; 6 | 7 | private String p2; 8 | 9 | private String p3; 10 | 11 | public String getP1() { 12 | return p1; 13 | } 14 | 15 | public void setP1(String p1) { 16 | this.p1 = p1; 17 | } 18 | 19 | public String getP2() { 20 | return p2; 21 | } 22 | 23 | public void setP2(String p2) { 24 | this.p2 = p2; 25 | } 26 | 27 | public String getP3() { 28 | return p3; 29 | } 30 | 31 | public void setP3(String p3) { 32 | this.p3 = p3; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=error, stdout 2 | 3 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | 6 | # Print the date in ISO 8601 format 7 | log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n 8 | 9 | log4j.appender.R=org.apache.log4j.RollingFileAppender 10 | log4j.appender.R.File=application.log 11 | 12 | log4j.appender.R.MaxFileSize=100KB 13 | # Keep one backup file 14 | log4j.appender.R.MaxBackupIndex=1 15 | 16 | log4j.appender.R.layout=org.apache.log4j.PatternLayout 17 | log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n 18 | 19 | log4j.category.org.springframework.jdbc=INFO 20 | 21 | -------------------------------------------------------------------------------- /mongodb-hello/src/main/resources/META-INF/spring/bootstrap.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /mongodb-customer-service-data/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | org.hibernate.ejb.HibernatePersistence 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /mongodb-hello/src/test/resources/org/springframework/data/mongodb/examples/hello/SimpleMongoTest-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/views/restaurants/update.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/views/restaurants/update.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | -------------------------------------------------------------------------------- /mongodb-music/src/test/resources/org/springframework/data/mongodb/examples/music/AbstractIntegrationTest-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/layouts/layouts.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/layouts/layouts.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/src/org/springframework/http/converter/json/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * 19 | * Provides an HttpMessageConverter implementations for handling JSON. 20 | * 21 | */ 22 | package org.springframework.http.converter.json; 23 | 24 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/layout/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 13 | 14 | 18 | 19 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/tags/menu/menu.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
    10 | 11 |
12 |
13 |
-------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/tags/menu/menu.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
    10 | 11 |
12 |
13 |
-------------------------------------------------------------------------------- /mongodb-hello/src/main/java/org/springframework/data/mongodb/examples/hello/App.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.examples.hello; 2 | 3 | import org.springframework.context.ConfigurableApplicationContext; 4 | import org.springframework.context.support.ClassPathXmlApplicationContext; 5 | 6 | /** 7 | * Hello Mongo! 8 | */ 9 | public class App 10 | { 11 | public static void main( String[] args ) { 12 | System.out.println("Bootstrapping HelloMongo"); 13 | 14 | ConfigurableApplicationContext context = null; 15 | // use @Configuration using Java: 16 | context = new ClassPathXmlApplicationContext("META-INF/spring/bootstrap.xml"); 17 | 18 | // use XML application context: 19 | //context = new ClassPathXmlApplicationContext("META-INF/spring/applicationContext.xml"); 20 | 21 | HelloMongo hello = context.getBean(HelloMongo.class); 22 | hello.run(); 23 | 24 | System.out.println( "DONE!" ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/src/org/springframework/http/converter/package-info.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Copyright 2002-2010 the original author or authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /** 19 | * 20 | * Provides an HttpMessageConverter abstraction to convert between Java objects and HTTP input/output messages. 21 | * 22 | */ 23 | package org.springframework.http.converter; 24 | 25 | -------------------------------------------------------------------------------- /mongodb-music/src/test/java/org/springframework/data/mongodb/examples/music/QueryDslIntegrationTests.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.examples.music; 2 | 3 | import org.junit.Before; 4 | import org.junit.Test; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.test.context.ContextConfiguration; 7 | 8 | 9 | /** 10 | * Sample test case showing the usage of Querydsl predicates. 11 | * 12 | * @author Oliver Gierke 13 | */ 14 | @ContextConfiguration 15 | public class QueryDslIntegrationTests extends AbstractIntegrationTest { 16 | 17 | @Autowired 18 | AlbumRepository repository; 19 | 20 | QAlbum album = QAlbum.album; 21 | 22 | @Override 23 | @Before 24 | public void setUp() { 25 | repository.deleteAll(); 26 | } 27 | 28 | @Test 29 | public void invokesQuerydslPredicateCorrectly() { 30 | 31 | repository.save(albums); 32 | assertSinglePursuitAlbum(repository.findOne(album.title.eq("The Pursuit"))); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/views/restaurants/views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/views/useraccounts/views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/views/restaurants/views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/views/useraccounts/views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/views/restaurants/show.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/views/restaurants/show.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | -------------------------------------------------------------------------------- /mongodb-music/src/test/resources/org/springframework/data/mongodb/examples/music/AlbumRepositoryIntegrationTest-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /mongodb-music/src/test/resources/org/springframework/data/mongodb/examples/music/QueryDslIntegrationTests-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/java/com/springone/myrestaurants/config/MongoConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.springone.myrestaurants.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.data.document.mongodb.MongoOperations; 6 | import org.springframework.data.document.mongodb.MongoTemplate; 7 | import org.springframework.data.document.mongodb.SimpleMongoDbFactory; 8 | 9 | import com.mongodb.Mongo; 10 | 11 | @Configuration 12 | public class MongoConfiguration { 13 | 14 | @Bean 15 | public MongoOperations mongoTemplate() throws Exception { 16 | 17 | Mongo m = new Mongo(); 18 | MongoOperations operations = new MongoTemplate(new SimpleMongoDbFactory(m, "mvc")); 19 | 20 | if (!operations.collectionExists("mvc")) { 21 | operations.createCollection("mvc"); 22 | } 23 | if (!operations.collectionExists("counters")) { 24 | operations.createCollection("counters"); 25 | } 26 | 27 | return operations; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/java/org/springframework/data/document/analytics/ControllerCounter.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.document.analytics; 2 | 3 | import java.util.Map; 4 | 5 | public class ControllerCounter { 6 | 7 | public String getName() { 8 | return name; 9 | } 10 | 11 | public void setName(String name) { 12 | this.name = name; 13 | } 14 | 15 | public double getCount() { 16 | return count; 17 | } 18 | 19 | public void setCount(double count) { 20 | this.count = count; 21 | } 22 | 23 | public Map getMethods() { 24 | return methods; 25 | } 26 | 27 | 28 | public void setMethods(Map methods) { 29 | this.methods = methods; 30 | } 31 | 32 | private String name; 33 | 34 | private double count; 35 | 36 | private Map methods; 37 | 38 | @Override 39 | public String toString() { 40 | return "ControllerCounter [name=" + name + ", count=" + count 41 | + ", methods=" + methods + "]"; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/views/restaurants/list.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/views/restaurants/list.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/views/views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/views/views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | org.hibernate.ejb.HibernatePersistence 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/views/restaurants/create.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/java/org/springframework/data/document/web/servlet/ActionInterceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.document.web.servlet; 17 | 18 | public interface ActionInterceptor { 19 | 20 | boolean preHandle(ActionExecutingContext actionExecutingContext); 21 | 22 | void postHandle(ActionExecutedContext actionExecutedContext); 23 | 24 | void afterCompletion(ActionExecutedContext actionExecutedContext); 25 | } 26 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | org.hibernate.ejb.HibernatePersistence 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/views/restaurants/create.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/src/org/springframework/http/HttpMethod.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2009 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.http; 18 | 19 | /** 20 | * Java 5 enumeration of HTTP request methods. Intended for use 21 | * with {@link org.springframework.http.client.ClientHttpRequest} 22 | * and {@link org.springframework.web.client.RestTemplate}. 23 | * 24 | * @author Arjen Poutsma 25 | * @since 3.0 26 | */ 27 | public enum HttpMethod { 28 | 29 | GET, POST, HEAD, OPTIONS, PUT, DELETE, TRACE 30 | 31 | } 32 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/views/useraccounts/update.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | -------------------------------------------------------------------------------- /mongodb-hello/src/main/java/org/springframework/data/mongodb/examples/hello/HelloMongo.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.examples.hello; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.data.mongodb.core.MongoOperations; 7 | import org.springframework.data.mongodb.examples.hello.domain.Account; 8 | import org.springframework.data.mongodb.examples.hello.domain.Person; 9 | import org.springframework.stereotype.Repository; 10 | 11 | @Repository 12 | public class HelloMongo { 13 | 14 | @Autowired 15 | MongoOperations mongoOperations; 16 | 17 | public void run() { 18 | 19 | if (mongoOperations.collectionExists(Person.class)) { 20 | mongoOperations.dropCollection(Person.class); 21 | } 22 | 23 | mongoOperations.createCollection(Person.class); 24 | 25 | Person p = new Person("John", 39); 26 | Account a = new Account("1234-59873-893-1", Account.Type.SAVINGS, 123.45D); 27 | p.getAccounts().add(a); 28 | 29 | mongoOperations.insert(p); 30 | 31 | List results = mongoOperations.findAll(Person.class); 32 | System.out.println("Results: " + results); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/views/useraccounts/update.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello World, MainActivity! 4 | My Restaurants 5 | Sign In 6 | Add to favorites 7 | Remove from favorites 8 | 9 | 10 | Restaurant Details 11 | Restaurant Description 12 | Event Sessions 13 | 14 | Favorite Restaurants 15 | 16 | 17 | Description 18 | Sessions 19 | Tweets 20 | Map 21 | 22 | 23 | 24 | Current 25 | Upcoming 26 | My Favorites 27 | Conference Favorites 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/layouts/default.jspx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | <spring:message code="welcome_h3" arguments="${app_name}" /> 15 | 16 | 17 | 18 |
19 | 20 | 21 |
22 | 23 | 24 |
25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/src/org/springframework/http/HttpMessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2009 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.http; 18 | 19 | /** 20 | * Represents the base interface for HTTP request and response messages. Consists of {@link HttpHeaders}, retrievable 21 | * via {@link #getHeaders()}. 22 | * 23 | * @author Arjen Poutsma 24 | * @since 3.0 25 | */ 26 | public interface HttpMessage { 27 | 28 | /** 29 | * Return the headers of this message. 30 | * @return a corresponding HttpHeaders object 31 | */ 32 | HttpHeaders getHeaders(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/layouts/default.jspx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | <spring:message code="welcome_h3" arguments="${app_name}" /> 15 | 16 | 17 | 18 |
19 | 20 | 21 |
22 | 23 | 24 |
25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/views/useraccounts/list.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/java/com/springone/myrestaurants/config/CouchDbConfig.java: -------------------------------------------------------------------------------- 1 | package com.springone.myrestaurants.config; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.http.converter.HttpMessageConverter; 9 | import org.springframework.http.converter.json.MappingJacksonHttpMessageConverter; 10 | import org.springframework.web.client.RestTemplate; 11 | 12 | import com.springone.myrestaurants.web.CouchDbMappingJacksonHttpMessageConverter; 13 | 14 | @Configuration 15 | public class CouchDbConfig { 16 | 17 | public static String URL = "http://127.0.0.1:5984/spring_demo/"; 18 | 19 | 20 | @Bean 21 | public RestTemplate restTemplate() { 22 | RestTemplate restTemplate = new RestTemplate(); 23 | List> converters = new ArrayList>(); 24 | 25 | //converters.add(new MappingJacksonHttpMessageConverter()); 26 | converters.add(new CouchDbMappingJacksonHttpMessageConverter()); 27 | restTemplate.setMessageConverters(converters); 28 | return restTemplate; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/views/useraccounts/list.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/views/useraccounts/create.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/views/useraccounts/create.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/views/useraccounts/show.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | -------------------------------------------------------------------------------- /mongodb-music/src/main/java/org/springframework/data/mongodb/examples/music/AlbumRepository.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.examples.music; 2 | 3 | import java.util.List; 4 | 5 | import org.bson.types.ObjectId; 6 | import org.springframework.data.querydsl.QueryDslPredicateExecutor; 7 | import org.springframework.data.repository.CrudRepository; 8 | 9 | 10 | /** 11 | * Simple repository interface to manage {@link Album} instances. 12 | * 13 | * @author Oliver Gierke 14 | */ 15 | public interface AlbumRepository extends CrudRepository, QueryDslPredicateExecutor { 16 | 17 | /** 18 | * Queries {@link Album}s by filtering on {@code tracks.name}. 19 | * 20 | * @param name 21 | * @return 22 | */ 23 | List findByTracksName(String name); 24 | 25 | 26 | /** 27 | * Returns all {@link Album} with a {@link Track} title like the given 28 | * parameter. 29 | * 30 | * @param name 31 | * @return 32 | */ 33 | List findByTracksNameLike(String name); 34 | 35 | 36 | /** 37 | * Returns all {@link Album}s with a {@link Track} having a rating greater 38 | * than the given one. 39 | * 40 | * @param rating 41 | * @return 42 | */ 43 | List findByTracksRatingGreaterThan(Stars rating); 44 | } 45 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/views/useraccounts/show.jspx: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | -------------------------------------------------------------------------------- /mongodb-customer-service-data/src/main/java/org/springframework/data/mongodb/examples/custsvc/domain/Customer.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.examples.custsvc.domain; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.GeneratedValue; 5 | import javax.persistence.GenerationType; 6 | import javax.persistence.Id; 7 | 8 | import org.springframework.data.persistence.document.RelatedDocument; 9 | 10 | @Entity 11 | public class Customer { 12 | 13 | @Id 14 | @GeneratedValue(strategy = GenerationType.IDENTITY) 15 | private Long id; 16 | 17 | private String firstName; 18 | 19 | private String lastName; 20 | 21 | @RelatedDocument 22 | private SurveyInfo surveyInfo; 23 | 24 | public String getFirstName() { 25 | return firstName; 26 | } 27 | 28 | public void setFirstName(String firstName) { 29 | this.firstName = firstName; 30 | } 31 | 32 | public String getLastName() { 33 | return lastName; 34 | } 35 | 36 | public void setLastName(String lastName) { 37 | this.lastName = lastName; 38 | } 39 | 40 | public Long getId() { 41 | return id; 42 | } 43 | 44 | public SurveyInfo getSurveyInfo() { 45 | return surveyInfo; 46 | } 47 | 48 | public void setSurveyInfo(SurveyInfo surveyInfo) { 49 | this.surveyInfo = surveyInfo; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/java/com/springone/myrestaurants/dao/JpaRestaurantDao.java: -------------------------------------------------------------------------------- 1 | package com.springone.myrestaurants.dao; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.EntityManager; 6 | import javax.persistence.PersistenceContext; 7 | 8 | import org.springframework.stereotype.Repository; 9 | 10 | import com.springone.myrestaurants.domain.Restaurant; 11 | 12 | //@Repository 13 | public class JpaRestaurantDao { 14 | 15 | @PersistenceContext 16 | private EntityManager entityManager; 17 | 18 | public Restaurant findRestaurant(Long id) { 19 | if (id == null) return null; 20 | return entityManager.find(Restaurant.class, id); 21 | } 22 | 23 | @SuppressWarnings("unchecked") 24 | public List findAllRestaurants() { 25 | return entityManager.createQuery("select o from Restaurant o").getResultList(); 26 | } 27 | 28 | @SuppressWarnings("unchecked") 29 | public List findRestaurantEntries(int firstResult, int maxResults) { 30 | return entityManager.createQuery("select o from Restaurant o").setFirstResult(firstResult).setMaxResults(maxResults).getResultList(); 31 | } 32 | 33 | public long countRestaurants() { 34 | return ((Number) entityManager.createQuery("select count(o) from Restaurant o").getSingleResult()).longValue(); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/java/com/springone/myrestaurants/dao/RestaurantDao.java: -------------------------------------------------------------------------------- 1 | package com.springone.myrestaurants.dao; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.EntityManager; 6 | import javax.persistence.PersistenceContext; 7 | 8 | import org.springframework.stereotype.Repository; 9 | 10 | import com.springone.myrestaurants.domain.Restaurant; 11 | 12 | @Repository 13 | public class RestaurantDao { 14 | 15 | @PersistenceContext 16 | private EntityManager entityManager; 17 | 18 | public Restaurant findRestaurant(Long id) { 19 | if (id == null) return null; 20 | return entityManager.find(Restaurant.class, id); 21 | } 22 | 23 | @SuppressWarnings("unchecked") 24 | public List findAllRestaurants() { 25 | return entityManager.createQuery("select o from Restaurant o").getResultList(); 26 | } 27 | 28 | @SuppressWarnings("unchecked") 29 | public List findRestaurantEntries(int firstResult, int maxResults) { 30 | return entityManager.createQuery("select o from Restaurant o").setFirstResult(firstResult).setMaxResults(maxResults).getResultList(); 31 | } 32 | 33 | public long countRestaurants() { 34 | return ((Number) entityManager.createQuery("select count(o) from Restaurant o").getSingleResult()).longValue(); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /mongodb-hello/src/main/java/org/springframework/data/mongodb/examples/hello/AppConfig.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.examples.hello; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor; 6 | import org.springframework.data.mongodb.core.MongoFactoryBean; 7 | import org.springframework.data.mongodb.core.MongoOperations; 8 | import org.springframework.data.mongodb.core.MongoTemplate; 9 | 10 | import com.mongodb.Mongo; 11 | 12 | @Configuration 13 | public class AppConfig { 14 | 15 | public @Bean MongoOperations mongoTemplate(Mongo mongo) { 16 | MongoTemplate mongoTemplate = new MongoTemplate(mongo, "test"); 17 | return mongoTemplate; 18 | } 19 | 20 | /* 21 | * Factory bean that creates the Mongo instance 22 | */ 23 | public @Bean MongoFactoryBean mongo() { 24 | MongoFactoryBean mongo = new MongoFactoryBean(); 25 | mongo.setHost("localhost"); 26 | return mongo; 27 | } 28 | 29 | /* 30 | * Use this post processor to translate any MongoExceptions thrown in @Repository annotated classes 31 | */ 32 | public @Bean PersistenceExceptionTranslationPostProcessor persistenceExceptionTranslationPostProcessor() { 33 | return new PersistenceExceptionTranslationPostProcessor(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/views/resourceNotFound.jspx: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |

${fn:escapeXml(title)}

6 |

7 | 8 |

9 | 10 |

11 |

12 | 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 |
25 |

26 |
27 |
28 |
-------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/views/uncaughtException.jspx: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |

${fn:escapeXml(title)}

6 |

7 | 8 |

9 | 10 |

11 |

12 | 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 |
25 |

26 |
27 |
28 |
-------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/views/resourceNotFound.jspx: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |

${fn:escapeXml(title)}

6 |

7 | 8 |

9 | 10 |

11 |

12 | 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 |
25 |

26 |
27 |
28 |
-------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/views/uncaughtException.jspx: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |

${fn:escapeXml(title)}

6 |

7 | 8 |

9 | 10 |

11 |

12 | 13 |

14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 |
25 |

26 |
27 |
28 |
-------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/tags/menu/category.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
  • 16 |

    17 | 18 |

    19 |
      20 | 21 |
    22 |
  • 23 | 24 |
    25 |
    -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/views/dataAccessFailure.jspx: -------------------------------------------------------------------------------- 1 |
    2 | 3 | 4 | 5 |

    ${fn:escapeXml(title)}

    6 |

    7 | 8 |

    9 | 10 |

    11 |

    12 | 13 |

    14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
    23 |
    24 |
    25 |

    26 |
    27 |
    28 |
    29 | 30 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/tags/menu/category.tagx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
  • 16 |

    17 | 18 |

    19 |
      20 | 21 |
    22 |
  • 23 | 24 |
    25 |
    -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/views/dataAccessFailure.jspx: -------------------------------------------------------------------------------- 1 |
    2 | 3 | 4 | 5 |

    ${fn:escapeXml(title)}

    6 |

    7 | 8 |

    9 | 10 |

    11 |

    12 | 13 |

    14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
    23 |
    24 |
    25 |

    26 |
    27 |
    28 |
    29 | 30 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/src/org/springframework/http/HttpInputMessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.http; 18 | 19 | import java.io.IOException; 20 | import java.io.InputStream; 21 | 22 | /** 23 | * Represents an HTTP input message, consisting of {@linkplain #getHeaders() headers} 24 | * and a readable {@linkplain #getBody() body}. 25 | * 26 | *

    Typically implemented by an HTTP request on the server-side, or a response on the client-side. 27 | * 28 | * @author Arjen Poutsma 29 | * @since 3.0 30 | */ 31 | public interface HttpInputMessage extends HttpMessage { 32 | 33 | /** 34 | * Return the body of the message as an input stream. 35 | * @return the input stream body 36 | * @throws IOException in case of I/O Errors 37 | */ 38 | InputStream getBody() throws IOException; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/src/org/springframework/http/HttpOutputMessage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2010 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.http; 18 | 19 | import java.io.IOException; 20 | import java.io.OutputStream; 21 | 22 | /** 23 | * Represents an HTTP output message, consisting of {@linkplain #getHeaders() headers} 24 | * and a writable {@linkplain #getBody() body}. 25 | * 26 | *

    Typically implemented by an HTTP request on the client-side, or a response on the server-side. 27 | * 28 | * @author Arjen Poutsma 29 | * @since 3.0 30 | */ 31 | public interface HttpOutputMessage extends HttpMessage { 32 | 33 | /** 34 | * Return the body of the message as an output stream. 35 | * @return the output stream body 36 | * @throws IOException in case of I/O Errors 37 | */ 38 | OutputStream getBody() throws IOException; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/webapp/WEB-INF/views/footer.jspx: -------------------------------------------------------------------------------- 1 | 2 |

    37 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/webapp/WEB-INF/views/footer.jspx: -------------------------------------------------------------------------------- 1 | 2 | 37 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/src/org/springframework/web/client/ResourceAccessException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2009 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.web.client; 18 | 19 | import java.io.IOException; 20 | 21 | /** 22 | * Exception thrown when an I/O error occurs. 23 | * 24 | * @author Arjen Poutsma 25 | * @since 3.0 26 | */ 27 | public class ResourceAccessException extends RestClientException { 28 | 29 | /** 30 | * Construct a new {@code HttpIOException} with the given message. 31 | * @param msg the message 32 | */ 33 | public ResourceAccessException(String msg) { 34 | super(msg); 35 | } 36 | 37 | /** 38 | * Construct a new {@code HttpIOException} with the given message and {@link IOException}. 39 | * @param msg the message 40 | * @param ex the {@code IOException} 41 | */ 42 | public ResourceAccessException(String msg, IOException ex) { 43 | super(msg, ex); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /mongodb-hello/src/main/java/org/springframework/data/mongodb/examples/hello/domain/Account.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.examples.hello.domain; 2 | 3 | public class Account { 4 | 5 | public enum Type { 6 | SAVINGS, CHECKING 7 | } 8 | 9 | private String id; 10 | 11 | private String accountNumber; 12 | 13 | private Account.Type accountType; 14 | 15 | private Double balance; 16 | 17 | public Account(){ 18 | } 19 | 20 | public Account(String accountNumber, Type accountType, Double balance) { 21 | super(); 22 | this.accountNumber = accountNumber; 23 | this.accountType = accountType; 24 | this.balance = balance; 25 | } 26 | 27 | public String getId() { 28 | return id; 29 | } 30 | 31 | public void setId(String id) { 32 | this.id = id; 33 | } 34 | 35 | public String getAccountNumber() { 36 | return accountNumber; 37 | } 38 | 39 | public void setAccountNumber(String accountNumber) { 40 | this.accountNumber = accountNumber; 41 | } 42 | 43 | public Account.Type getAccountType() { 44 | return accountType; 45 | } 46 | 47 | public void setAccountType(Account.Type accountType) { 48 | this.accountType = accountType; 49 | } 50 | 51 | public Double getBalance() { 52 | return balance; 53 | } 54 | 55 | public void setBalance(Double balance) { 56 | this.balance = balance; 57 | } 58 | 59 | @Override 60 | public String toString() { 61 | return "Account [id=" + id + ", accountNumber=" + accountNumber 62 | + ", accountType=" + accountType + ", balance=" + balance + "]"; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /couchdb-myrestaurants/src/main/java/com/springone/myrestaurants/dao/JpaUserAccountDao.java: -------------------------------------------------------------------------------- 1 | package com.springone.myrestaurants.dao; 2 | 3 | import javax.persistence.EntityManager; 4 | import javax.persistence.PersistenceContext; 5 | import javax.persistence.Query; 6 | 7 | import org.springframework.stereotype.Repository; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import com.springone.myrestaurants.domain.UserAccount; 11 | 12 | //@Repository 13 | public class JpaUserAccountDao { 14 | 15 | @PersistenceContext 16 | private EntityManager entityManager; 17 | 18 | public UserAccount findUserAccount(Long id) { 19 | if (id == null) return null; 20 | return entityManager.find(UserAccount.class, id); 21 | } 22 | 23 | public UserAccount findByName(String name) { 24 | if (name == null) return null; 25 | Query q = entityManager.createQuery("SELECT u FROM UserAccount u WHERE u.userName = :username"); 26 | q.setParameter("username", name); 27 | 28 | java.util.List resultList = q.getResultList(); 29 | if (resultList.size() > 0) 30 | { 31 | return (UserAccount) resultList.get(0); 32 | } 33 | return null; 34 | } 35 | 36 | @Transactional 37 | public void persist(UserAccount userAccount) { 38 | this.entityManager.persist(userAccount); 39 | } 40 | 41 | @Transactional 42 | public UserAccount merge(UserAccount userAccount) { 43 | UserAccount merged = this.entityManager.merge(userAccount); 44 | this.entityManager.flush(); 45 | return merged; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /mongodb-hello/src/main/java/org/springframework/data/mongodb/examples/hello/domain/Person.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.examples.hello.domain; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.springframework.data.annotation.Id; 7 | import org.springframework.data.mongodb.core.mapping.Document; 8 | 9 | @Document 10 | public class Person { 11 | 12 | @Id 13 | private String id; 14 | 15 | private String name; 16 | 17 | private int age; 18 | 19 | private List accounts = new ArrayList(); 20 | 21 | public Person() { 22 | } 23 | 24 | public Person(String name, int age) { 25 | super(); 26 | this.name = name; 27 | this.age = age; 28 | } 29 | 30 | public String getId() { 31 | return id; 32 | } 33 | 34 | public void setId(String id) { 35 | this.id = id; 36 | } 37 | 38 | public String getName() { 39 | return name; 40 | } 41 | 42 | public void setName(String name) { 43 | this.name = name; 44 | } 45 | 46 | public int getAge() { 47 | return age; 48 | } 49 | 50 | public void setAge(int age) { 51 | this.age = age; 52 | } 53 | 54 | public List getAccounts() { 55 | return accounts; 56 | } 57 | 58 | public void addAccount(Account account) { 59 | this.accounts.add(account); 60 | } 61 | 62 | public void setAccounts(List accounts) { 63 | this.accounts = accounts; 64 | } 65 | 66 | @Override 67 | public String toString() { 68 | return "Person [id=" + id + ", name=" + name + ", age=" + age 69 | + ", accounts=" + accounts + "]"; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /mongodb-myrestaurants-analytics/src/main/java/com/springone/myrestaurants/dao/UserAccountDao.java: -------------------------------------------------------------------------------- 1 | package com.springone.myrestaurants.dao; 2 | 3 | import javax.persistence.EntityManager; 4 | import javax.persistence.PersistenceContext; 5 | import javax.persistence.Query; 6 | 7 | import org.springframework.stereotype.Repository; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import com.springone.myrestaurants.domain.UserAccount; 11 | 12 | @Repository 13 | public class UserAccountDao { 14 | 15 | @PersistenceContext 16 | private EntityManager entityManager; 17 | 18 | public UserAccount findUserAccount(Long id) { 19 | if (id == null) return null; 20 | return entityManager.find(UserAccount.class, id); 21 | } 22 | 23 | public UserAccount findByName(String name) { 24 | if (name == null) return null; 25 | Query q = entityManager.createQuery("SELECT u FROM UserAccount u WHERE u.userName = :username"); 26 | q.setParameter("username", name); 27 | 28 | java.util.List resultList = q.getResultList(); 29 | if (resultList.size() > 0) 30 | { 31 | return (UserAccount) resultList.get(0); 32 | } 33 | return null; 34 | } 35 | 36 | @Transactional 37 | public void persist(UserAccount userAccount) { 38 | this.entityManager.persist(userAccount); 39 | } 40 | 41 | @Transactional 42 | public UserAccount merge(UserAccount userAccount) { 43 | UserAccount merged = this.entityManager.merge(userAccount); 44 | this.entityManager.flush(); 45 | return merged; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /couchdb-myrestaurants-android/res/layout/event_details.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 9 | 10 | 14 | 15 | 21 | 22 | 25 | 26 | 29 | 30 | 33 | 34 | 35 | 36 |