├── 1 - springIntro ├── .classpath ├── .gitignore ├── .project ├── libs │ ├── spring-aop-5.3.7-javadoc.jar │ ├── spring-aop-5.3.7-sources.jar │ ├── spring-aop-5.3.7.jar │ ├── spring-aspects-5.3.7-javadoc.jar │ ├── spring-aspects-5.3.7-sources.jar │ ├── spring-aspects-5.3.7.jar │ ├── spring-beans-5.3.7-javadoc.jar │ ├── spring-beans-5.3.7-sources.jar │ ├── spring-beans-5.3.7.jar │ ├── spring-context-5.3.7-javadoc.jar │ ├── spring-context-5.3.7-sources.jar │ ├── spring-context-5.3.7.jar │ ├── spring-context-indexer-5.3.7-javadoc.jar │ ├── spring-context-indexer-5.3.7-sources.jar │ ├── spring-context-indexer-5.3.7.jar │ ├── spring-context-support-5.3.7-javadoc.jar │ ├── spring-context-support-5.3.7-sources.jar │ ├── spring-context-support-5.3.7.jar │ ├── spring-core-5.3.7-javadoc.jar │ ├── spring-core-5.3.7-sources.jar │ ├── spring-core-5.3.7.jar │ ├── spring-expression-5.3.7-javadoc.jar │ ├── spring-expression-5.3.7-sources.jar │ ├── spring-expression-5.3.7.jar │ ├── spring-instrument-5.3.7-javadoc.jar │ ├── spring-instrument-5.3.7-sources.jar │ ├── spring-instrument-5.3.7.jar │ ├── spring-jcl-5.3.7-javadoc.jar │ ├── spring-jcl-5.3.7-sources.jar │ ├── spring-jcl-5.3.7.jar │ ├── spring-jdbc-5.3.7-javadoc.jar │ ├── spring-jdbc-5.3.7-sources.jar │ ├── spring-jdbc-5.3.7.jar │ ├── spring-jms-5.3.7-javadoc.jar │ ├── spring-jms-5.3.7-sources.jar │ ├── spring-jms-5.3.7.jar │ ├── spring-messaging-5.3.7-javadoc.jar │ ├── spring-messaging-5.3.7-sources.jar │ ├── spring-messaging-5.3.7.jar │ ├── spring-orm-5.3.7-javadoc.jar │ ├── spring-orm-5.3.7-sources.jar │ ├── spring-orm-5.3.7.jar │ ├── spring-oxm-5.3.7-javadoc.jar │ ├── spring-oxm-5.3.7-sources.jar │ ├── spring-oxm-5.3.7.jar │ ├── spring-r2dbc-5.3.7-javadoc.jar │ ├── spring-r2dbc-5.3.7-sources.jar │ ├── spring-r2dbc-5.3.7.jar │ ├── spring-test-5.3.7-javadoc.jar │ ├── spring-test-5.3.7-sources.jar │ ├── spring-test-5.3.7.jar │ ├── spring-tx-5.3.7-javadoc.jar │ ├── spring-tx-5.3.7-sources.jar │ ├── spring-tx-5.3.7.jar │ ├── spring-web-5.3.7-javadoc.jar │ ├── spring-web-5.3.7-sources.jar │ ├── spring-web-5.3.7.jar │ ├── spring-webflux-5.3.7-javadoc.jar │ ├── spring-webflux-5.3.7-sources.jar │ ├── spring-webflux-5.3.7.jar │ ├── spring-webmvc-5.3.7-javadoc.jar │ ├── spring-webmvc-5.3.7-sources.jar │ ├── spring-webmvc-5.3.7.jar │ ├── spring-websocket-5.3.7-javadoc.jar │ ├── spring-websocket-5.3.7-sources.jar │ └── spring-websocket-5.3.7.jar └── src │ ├── applicationContext.xml │ ├── springIntro │ ├── CustomerDalService.java │ ├── CustomerManager.java │ ├── CustomerManagerService.java │ ├── Main.java │ ├── MsSqlCustomerDal.java │ ├── MySqlCustomerDal.java │ └── OracleCustomerDal.java │ └── values.properties ├── 2 - springDemoIoCAnnotation ├── .classpath ├── .gitignore ├── .project └── src │ ├── applicationContext.xml │ ├── com │ └── springdemo │ │ ├── CustomerDalService.java │ │ ├── CustomerManager.java │ │ ├── CustomerManagerService.java │ │ ├── IocConfig.java │ │ ├── Main.java │ │ ├── MsSqlCustomerDal.java │ │ └── MySqlCustomerDal.java │ └── values.properties ├── 3 - hibernateDemo ├── .classpath ├── .gitignore ├── .project ├── libs │ ├── FastInfoset-1.2.15.jar │ ├── antlr-2.7.7.jar │ ├── byte-buddy-1.10.21.jar │ ├── classmate-1.5.1.jar │ ├── dom4j-2.1.3.jar │ ├── hibernate-commons-annotations-5.1.2.Final.jar │ ├── hibernate-core-5.4.31.Final.jar │ ├── istack-commons-runtime-3.0.7.jar │ ├── jandex-2.2.3.Final.jar │ ├── javassist-3.27.0-GA.jar │ ├── javax.activation-api-1.2.0.jar │ ├── javax.persistence-api-2.2.jar │ ├── jaxb-api-2.3.1.jar │ ├── jaxb-runtime-2.3.1.jar │ ├── jboss-logging-3.4.1.Final.jar │ ├── jboss-transaction-api_1.2_spec-1.1.1.Final.jar │ ├── mysql-connector-java-8.0.19.jar │ ├── stax-ex-1.8.jar │ └── txw2-2.3.1.jar └── src │ ├── com │ └── hibernateDemo │ │ ├── City.java │ │ └── Main.java │ └── hibernate.cfg.xml ├── 4 - mavenIntro └── intro │ ├── .classpath │ ├── .gitignore │ ├── .project │ ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.m2e.core.prefs │ ├── pom.xml │ └── src │ ├── main │ └── java │ │ └── com │ │ └── icanerdogan │ │ └── intro │ │ └── App.java │ └── test │ └── java │ └── com │ └── icanerdogan │ └── intro │ └── AppTest.java ├── 5 - springBootDemo └── springBootDemo │ ├── .gitignore │ ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── icanerdogan │ │ │ └── springBootDemo │ │ │ ├── SpringBootDemoApplication.java │ │ │ └── apiDemo │ │ │ └── ProductsController.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── icanerdogan │ └── springBootDemo │ └── SpringBootDemoApplicationTests.java ├── 6 - hibernateAndJpa └── hibernateAndJpa │ ├── .gitignore │ ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── icanerdogan │ │ │ └── hibernateAndJpa │ │ │ ├── Business │ │ │ ├── Abstracts │ │ │ │ └── CityService.java │ │ │ └── Concretes │ │ │ │ └── CityManager.java │ │ │ ├── DataAccess │ │ │ ├── Abstracts │ │ │ │ └── CityDal.java │ │ │ └── Concretes │ │ │ │ └── HibernateCityDal.java │ │ │ ├── Entities │ │ │ └── City.java │ │ │ ├── HibernateAndJpaApplication.java │ │ │ └── restApi │ │ │ └── CityController.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── icanerdogan │ └── hibernateAndJpa │ └── HibernateAndJpaApplicationTests.java └── README.md /1 - springIntro/.classpath: -------------------------------------------------------------------------------- 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 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /1 - springIntro/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | -------------------------------------------------------------------------------- /1 - springIntro/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | springIntro 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-aop-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-aop-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-aop-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-aop-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-aop-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-aop-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-aspects-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-aspects-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-aspects-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-aspects-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-aspects-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-aspects-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-beans-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-beans-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-beans-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-beans-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-beans-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-beans-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-context-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-context-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-context-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-context-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-context-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-context-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-context-indexer-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-context-indexer-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-context-indexer-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-context-indexer-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-context-indexer-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-context-indexer-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-context-support-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-context-support-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-context-support-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-context-support-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-context-support-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-context-support-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-core-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-core-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-core-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-core-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-core-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-core-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-expression-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-expression-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-expression-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-expression-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-expression-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-expression-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-instrument-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-instrument-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-instrument-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-instrument-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-instrument-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-instrument-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-jcl-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-jcl-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-jcl-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-jcl-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-jcl-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-jcl-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-jdbc-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-jdbc-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-jdbc-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-jdbc-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-jdbc-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-jdbc-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-jms-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-jms-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-jms-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-jms-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-jms-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-jms-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-messaging-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-messaging-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-messaging-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-messaging-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-messaging-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-messaging-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-orm-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-orm-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-orm-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-orm-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-orm-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-orm-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-oxm-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-oxm-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-oxm-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-oxm-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-oxm-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-oxm-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-r2dbc-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-r2dbc-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-r2dbc-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-r2dbc-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-r2dbc-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-r2dbc-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-test-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-test-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-test-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-test-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-test-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-test-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-tx-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-tx-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-tx-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-tx-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-tx-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-tx-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-web-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-web-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-web-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-web-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-web-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-web-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-webflux-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-webflux-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-webflux-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-webflux-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-webflux-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-webflux-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-webmvc-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-webmvc-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-webmvc-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-webmvc-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-webmvc-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-webmvc-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-websocket-5.3.7-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-websocket-5.3.7-javadoc.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-websocket-5.3.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-websocket-5.3.7-sources.jar -------------------------------------------------------------------------------- /1 - springIntro/libs/spring-websocket-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/1 - springIntro/libs/spring-websocket-5.3.7.jar -------------------------------------------------------------------------------- /1 - springIntro/src/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /1 - springIntro/src/springIntro/CustomerDalService.java: -------------------------------------------------------------------------------- 1 | package springIntro; 2 | 3 | public interface CustomerDalService { 4 | 5 | void add(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /1 - springIntro/src/springIntro/CustomerManager.java: -------------------------------------------------------------------------------- 1 | package springIntro; 2 | 3 | // Çıplak Class: Herhangi bir implement veya extends almayan class'dır 4 | // Projelerimizde çıplak class kalmamalıdır 5 | 6 | public class CustomerManager implements CustomerManagerService{ 7 | //Dependency Injection 8 | private CustomerDalService customerService; 9 | 10 | // Constructor Injection 11 | public CustomerManager(CustomerDalService customerService) { 12 | super(); 13 | this.customerService = customerService; 14 | } 15 | 16 | public void add() { 17 | customerService.add(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /1 - springIntro/src/springIntro/CustomerManagerService.java: -------------------------------------------------------------------------------- 1 | package springIntro; 2 | 3 | public interface CustomerManagerService { 4 | void add(); 5 | } 6 | -------------------------------------------------------------------------------- /1 - springIntro/src/springIntro/Main.java: -------------------------------------------------------------------------------- 1 | package springIntro; 2 | 3 | import org.springframework.context.support.ClassPathXmlApplicationContext; 4 | 5 | public class Main { 6 | 7 | public static void main(String[] args) { 8 | 9 | // Burada new Objesi mesela 100 yerde kullanılsa heryerde değiştirmek yerine IOC kullanıyoruz! 10 | // CustomerManager customerManager = new CustomerManager(new MySqlCustomerDal()); 11 | // customerManager.add(); 12 | 13 | 14 | ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml"); 15 | 16 | //IoC - Inversion of Controll 17 | // getBean("database") burada applicationContext dosyasında ID'si database olan kısımdaki class'ı döndürecek! 18 | //CustomerManager customerManager = new CustomerManager(context.getBean("database", CustomerDalService.class)); 19 | //customerManager.add(); 20 | 21 | //Yukarıdaki oluşturulan kısım doğru ancak "new" sayısını azaltmak için CustomerManager sınıfımızı bir interface'e bağladık 22 | // applicastionContext içinde "constructor-arg" etiketiyle 23 | CustomerManagerService customerService = context.getBean("service", CustomerManagerService.class); 24 | 25 | customerService.add(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /1 - springIntro/src/springIntro/MsSqlCustomerDal.java: -------------------------------------------------------------------------------- 1 | package springIntro; 2 | 3 | public class MsSqlCustomerDal implements CustomerDalService{ 4 | // applicationContext.xml içinde bu String değerini implement edilen sınıfa göre değiştirildi! 5 | String connectionString; 6 | 7 | @Override 8 | public void add() { 9 | System.out.println("Connection String: "+ this.connectionString); 10 | System.out.println("MSSQL Veritabanına Eklendi!"); 11 | } 12 | 13 | public String getConnectionString() { 14 | return connectionString; 15 | } 16 | 17 | public void setConnectionString(String connectionString) { 18 | this.connectionString = connectionString; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /1 - springIntro/src/springIntro/MySqlCustomerDal.java: -------------------------------------------------------------------------------- 1 | package springIntro; 2 | 3 | public class MySqlCustomerDal implements CustomerDalService{ 4 | // applicationContext.xml içinde bu String değerini implement edilen sınıfa göre değiştirildi! 5 | String connectionString; 6 | 7 | @Override 8 | public void add() { 9 | System.out.println("Connection String: "+ this.connectionString); 10 | System.out.println("MySQL Veritabanına Eklendi!"); 11 | 12 | } 13 | 14 | public String getConnectionString() { 15 | return connectionString; 16 | } 17 | 18 | public void setConnectionString(String connectionString) { 19 | this.connectionString = connectionString; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /1 - springIntro/src/springIntro/OracleCustomerDal.java: -------------------------------------------------------------------------------- 1 | package springIntro; 2 | 3 | public class OracleCustomerDal implements CustomerDalService{ 4 | // applicationContext.xml içinde bu String değerini implement edilen sınıfa göre değiştirildi! 5 | String connectionString; 6 | 7 | @Override 8 | public void add() { 9 | System.out.println("Connection String: "+ this.connectionString); 10 | System.out.println("Oracle Veritabanına Eklendi!"); 11 | } 12 | 13 | public String getConnectionString() { 14 | return connectionString; 15 | } 16 | 17 | public void setConnectionString(String connectionString) { 18 | this.connectionString = connectionString; 19 | } 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /1 - springIntro/src/values.properties: -------------------------------------------------------------------------------- 1 | database.sqlConnectionString=bağlanti metni 2 | local.email=ibrahim4545erdogan@gmail.com -------------------------------------------------------------------------------- /2 - springDemoIoCAnnotation/.classpath: -------------------------------------------------------------------------------- 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 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /2 - springDemoIoCAnnotation/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | -------------------------------------------------------------------------------- /2 - springDemoIoCAnnotation/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | springDemoIoCAnnotation 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /2 - springDemoIoCAnnotation/src/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /2 - springDemoIoCAnnotation/src/com/springdemo/CustomerDalService.java: -------------------------------------------------------------------------------- 1 | package com.springdemo; 2 | 3 | public interface CustomerDalService { 4 | 5 | void add(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /2 - springDemoIoCAnnotation/src/com/springdemo/CustomerManager.java: -------------------------------------------------------------------------------- 1 | package com.springdemo; 2 | 3 | // Çıplak Class: Herhangi bir implement veya extends almayan class'dır 4 | // Projelerimizde çıplak class kalmamalıdır 5 | 6 | public class CustomerManager implements CustomerManagerService{ 7 | //Dependency Injection 8 | private CustomerDalService customerService; 9 | 10 | // Constructor Injection 11 | public CustomerManager(CustomerDalService customerService) { 12 | super(); 13 | this.customerService = customerService; 14 | } 15 | 16 | public void add() { 17 | customerService.add(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /2 - springDemoIoCAnnotation/src/com/springdemo/CustomerManagerService.java: -------------------------------------------------------------------------------- 1 | package com.springdemo; 2 | 3 | public interface CustomerManagerService { 4 | void add(); 5 | } 6 | -------------------------------------------------------------------------------- /2 - springDemoIoCAnnotation/src/com/springdemo/IocConfig.java: -------------------------------------------------------------------------------- 1 | package com.springdemo; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.ComponentScan; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.context.annotation.PropertySource; 7 | 8 | @Configuration 9 | // Artık oluşturduğumuz bu sınıf ve eklediğimiz ComponentScan ile bu applicationContext.xml kullanımını sonlandırdık. 10 | @ComponentScan("com.springdemo") 11 | @PropertySource("classpath:values.properties") 12 | public class IocConfig { 13 | 14 | //Diğer Dal sınıfların başına Components("database") yapmak yerine xml dosyasındaki gibi class'lar ekledik. 15 | @Bean 16 | public CustomerDalService database() { 17 | return new MsSqlCustomerDal(); 18 | } 19 | 20 | @Bean 21 | public CustomerManagerService service() { 22 | return new CustomerManager(database()); 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /2 - springDemoIoCAnnotation/src/com/springdemo/Main.java: -------------------------------------------------------------------------------- 1 | package com.springdemo; 2 | 3 | import org.springframework.context.annotation.AnnotationConfigApplicationContext; 4 | import org.springframework.context.support.ClassPathXmlApplicationContext; 5 | 6 | public class Main { 7 | 8 | public static void main(String[] args) { 9 | 10 | 11 | AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(IocConfig.class); 12 | 13 | // "context" diğer context dosyasından aldığımız için refresh yaptık! 14 | //context.refresh(); 15 | 16 | //IocConfig.java dosyasında "database" fonksiyonu oluşturduk 17 | // CustomerDalService customerDalService = context.getBean("database", CustomerDalService.class); 18 | // customerDalService.add(); 19 | 20 | CustomerManagerService customerManagerService = context.getBean("service",CustomerManagerService.class); 21 | customerManagerService.add(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /2 - springDemoIoCAnnotation/src/com/springdemo/MsSqlCustomerDal.java: -------------------------------------------------------------------------------- 1 | package com.springdemo; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | 5 | public class MsSqlCustomerDal implements CustomerDalService{ 6 | // Bu Stringi nereden okuyayacağını "PropertySource" içinde dosya yolunu verdik 7 | @Value("${database.sqlConnectionString}") 8 | String connectionString; 9 | 10 | @Override 11 | public void add() { 12 | System.out.println("Connection String: "+ this.connectionString); 13 | System.out.println("MSSQL Veritabanına Eklendi!"); 14 | } 15 | 16 | public String getConnectionString() { 17 | return connectionString; 18 | } 19 | 20 | public void setConnectionString(String connectionString) { 21 | this.connectionString = connectionString; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /2 - springDemoIoCAnnotation/src/com/springdemo/MySqlCustomerDal.java: -------------------------------------------------------------------------------- 1 | package com.springdemo; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | 5 | public class MySqlCustomerDal implements CustomerDalService{ 6 | // Bu Stringi nereden okuyayacağını "PropertySource" içinde dosya yolunu verdik 7 | @Value("${database.sqlConnectionString}") 8 | String connectionString; 9 | 10 | @Override 11 | public void add() { 12 | System.out.println("Connection String: "+ this.connectionString); 13 | System.out.println("MySQL Veritabanına Eklendi!"); 14 | 15 | } 16 | 17 | public String getConnectionString() { 18 | return connectionString; 19 | } 20 | 21 | public void setConnectionString(String connectionString) { 22 | this.connectionString = connectionString; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /2 - springDemoIoCAnnotation/src/values.properties: -------------------------------------------------------------------------------- 1 | database.sqlConnectionString=baglanti metni 2 | local.email=deneme@gmail.com -------------------------------------------------------------------------------- /3 - hibernateDemo/.classpath: -------------------------------------------------------------------------------- 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 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /3 - hibernateDemo/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | -------------------------------------------------------------------------------- /3 - hibernateDemo/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | hibernateDemo 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /3 - hibernateDemo/libs/FastInfoset-1.2.15.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/3 - hibernateDemo/libs/FastInfoset-1.2.15.jar -------------------------------------------------------------------------------- /3 - hibernateDemo/libs/antlr-2.7.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/3 - hibernateDemo/libs/antlr-2.7.7.jar -------------------------------------------------------------------------------- /3 - hibernateDemo/libs/byte-buddy-1.10.21.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/3 - hibernateDemo/libs/byte-buddy-1.10.21.jar -------------------------------------------------------------------------------- /3 - hibernateDemo/libs/classmate-1.5.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/3 - hibernateDemo/libs/classmate-1.5.1.jar -------------------------------------------------------------------------------- /3 - hibernateDemo/libs/dom4j-2.1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/3 - hibernateDemo/libs/dom4j-2.1.3.jar -------------------------------------------------------------------------------- /3 - hibernateDemo/libs/hibernate-commons-annotations-5.1.2.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/3 - hibernateDemo/libs/hibernate-commons-annotations-5.1.2.Final.jar -------------------------------------------------------------------------------- /3 - hibernateDemo/libs/hibernate-core-5.4.31.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/3 - hibernateDemo/libs/hibernate-core-5.4.31.Final.jar -------------------------------------------------------------------------------- /3 - hibernateDemo/libs/istack-commons-runtime-3.0.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/3 - hibernateDemo/libs/istack-commons-runtime-3.0.7.jar -------------------------------------------------------------------------------- /3 - hibernateDemo/libs/jandex-2.2.3.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/3 - hibernateDemo/libs/jandex-2.2.3.Final.jar -------------------------------------------------------------------------------- /3 - hibernateDemo/libs/javassist-3.27.0-GA.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/3 - hibernateDemo/libs/javassist-3.27.0-GA.jar -------------------------------------------------------------------------------- /3 - hibernateDemo/libs/javax.activation-api-1.2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/3 - hibernateDemo/libs/javax.activation-api-1.2.0.jar -------------------------------------------------------------------------------- /3 - hibernateDemo/libs/javax.persistence-api-2.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/3 - hibernateDemo/libs/javax.persistence-api-2.2.jar -------------------------------------------------------------------------------- /3 - hibernateDemo/libs/jaxb-api-2.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/3 - hibernateDemo/libs/jaxb-api-2.3.1.jar -------------------------------------------------------------------------------- /3 - hibernateDemo/libs/jaxb-runtime-2.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/3 - hibernateDemo/libs/jaxb-runtime-2.3.1.jar -------------------------------------------------------------------------------- /3 - hibernateDemo/libs/jboss-logging-3.4.1.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/3 - hibernateDemo/libs/jboss-logging-3.4.1.Final.jar -------------------------------------------------------------------------------- /3 - hibernateDemo/libs/jboss-transaction-api_1.2_spec-1.1.1.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/3 - hibernateDemo/libs/jboss-transaction-api_1.2_spec-1.1.1.Final.jar -------------------------------------------------------------------------------- /3 - hibernateDemo/libs/mysql-connector-java-8.0.19.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/3 - hibernateDemo/libs/mysql-connector-java-8.0.19.jar -------------------------------------------------------------------------------- /3 - hibernateDemo/libs/stax-ex-1.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/3 - hibernateDemo/libs/stax-ex-1.8.jar -------------------------------------------------------------------------------- /3 - hibernateDemo/libs/txw2-2.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/3 - hibernateDemo/libs/txw2-2.3.1.jar -------------------------------------------------------------------------------- /3 - hibernateDemo/src/com/hibernateDemo/City.java: -------------------------------------------------------------------------------- 1 | package com.hibernateDemo; 2 | 3 | 4 | import javax.persistence.Entity; 5 | import javax.persistence.Table; 6 | 7 | import javax.persistence.Id; 8 | import javax.persistence.Column; 9 | 10 | @Entity // City Class'ımız bir veritabanı nesnesi olduğunu bu Annotation ile veriyoruz. 11 | @Table(name="city") // City Class'ımız hangi tabloya bağlıdır. 12 | public class City { 13 | // Tablodaki tüm sütun değerlerini ekliyoruz 14 | @Id // Tablomuzun "ID" kolonu Id'yi bize verdiğini bu annotation ile gösteriyoruz. 15 | @Column(name="ID") 16 | private int id; 17 | @Column(name="Name") 18 | private String name; 19 | @Column(name="CountryCode") 20 | private String countryCode; 21 | @Column(name="District") 22 | private String district; 23 | @Column(name="Population") 24 | private int population; 25 | 26 | 27 | public int getId() { 28 | return id; 29 | } 30 | public void setId(int id) { 31 | this.id = id; 32 | } 33 | public String getName() { 34 | return name; 35 | } 36 | public void setName(String name) { 37 | this.name = name; 38 | } 39 | public String getCountryCode() { 40 | return countryCode; 41 | } 42 | public void setCountryCode(String countryCode) { 43 | this.countryCode = countryCode; 44 | } 45 | public String getDistrict() { 46 | return district; 47 | } 48 | public void setDistrict(String district) { 49 | this.district = district; 50 | } 51 | public int getPopulation() { 52 | return population; 53 | } 54 | public void setPopulation(int population) { 55 | this.population = population; 56 | } 57 | 58 | 59 | } 60 | -------------------------------------------------------------------------------- /3 - hibernateDemo/src/com/hibernateDemo/Main.java: -------------------------------------------------------------------------------- 1 | package com.hibernateDemo; 2 | 3 | import java.util.List; 4 | 5 | import org.hibernate.Session; 6 | import org.hibernate.SessionFactory; 7 | import org.hibernate.cfg.Configuration; 8 | 9 | public class Main { 10 | 11 | public static void main(String[] args) { 12 | // Session'lar bizim Veritabanına sorgu göndermek için kullanılır ve normal sorgulardan farklı örnek olarak 13 | // eklediğimiz bir veriyi, update vs. gibi tek seferde yönetmeyi sağlar. 14 | // Örnek olarak banka hesabımızdan para gönderdiğimizde hesabımızın bakiyesi güncellenir ancak bir hata olduğunda hesabımızdaki para gitmez! Session bu işlemi sağlıyor, geri dönülebilir işlemler. 15 | // Sorgularımızı göndermek için "SessionFactory" sınfını kullanırız. 16 | 17 | SessionFactory factory = new Configuration() 18 | .configure("hibernate.cfg.xml") 19 | .addAnnotatedClass(City.class) 20 | .buildSessionFactory(); 21 | 22 | Session session = factory.getCurrentSession(); // Session ile sorgulamalarımızı gönderiririz. 23 | 24 | try { 25 | session.beginTransaction(); 26 | 27 | // Gelen datayı ArrayLis'te çekiyoruz. 28 | // Select * From city 29 | // List cities = session.createQuery("from City").getResultList(); 30 | 31 | 32 | // KOŞULLU SORGULAR 33 | 34 | // countryCode'u TUR olan veya USA olan şehirleri getir 35 | List cities = session.createQuery("from City c where c.countryCode='TUR' OR c.countryCode='USA'").getResultList(); 36 | 37 | // countryCode'u TUR olan ve bölgesi Ankara olan şehirler 38 | List cities = session.createQuery("from City c where c.countryCode='TUR' AND c.district='Ankara'").getResultList(); 39 | 40 | // İsminde "kar" geçen şehir isimleri getirme sorgusu 41 | // %kar -> kar ile başlayan 42 | // kar% -> kar ile biten şehir isimleri 43 | List cities = session.createQuery("from City c where c.name LIKE '%kar%'").getResultList(); 44 | 45 | 46 | //ORDER BY - Sıralama 47 | 48 | // Default olarak ASC sıralamsında gelir ancak DESC ile sıralamayı tersine çevirebilirsin! 49 | List cities = session.createQuery("from City c ORDER BY c.name DESC").getResultList(); 50 | 51 | 52 | //GROUP BY - Gruplama 53 | 54 | //City içinden countryCode'ları grupla, ve o şehir kodlarını ekrana yazdır! 55 | List countryCodes = session.createQuery("select c.countryCode from City c GROUP BY c.countryCode").getResultList(); 56 | 57 | 58 | for(String countryCode:countryCodes) { 59 | System.out.println(countryCode); 60 | } 61 | 62 | 63 | 64 | // INSERT - Ekleme 65 | 66 | City city = new City(); 67 | city.setName("Düzce"); 68 | city.setCountryCode("TUR"); 69 | city.setDistrict("Karadeniz"); 70 | city.setPopulation(100000); 71 | 72 | session.save(city); 73 | 74 | 75 | // UPDATE - Güncelleme 76 | 77 | City city2 = session.get(City.class, 1); // ID'si 1 olan elemanı seçtik 78 | System.out.println("City2: "+ city2.getPopulation()); 79 | 80 | city2.setPopulation(110000); 81 | System.out.println("Güncellenen City2: "+ city2.getPopulation()); 82 | session.save(city2); 83 | 84 | 85 | // DELETE - Silme 86 | 87 | City city3 = session.get(City.class, 2); 88 | session.delete(city3); 89 | 90 | session.getTransaction().commit(); 91 | 92 | //System.out.println("Şehir Eklendi!"); 93 | //System.out.println("Şehir Güncellendi!"); 94 | //System.out.println("Şehir Silindi!"); 95 | }finally { 96 | factory.close(); 97 | } 98 | 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /3 - hibernateDemo/src/hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | com.mysql.jdbc.Driver 9 | jdbc:mysql://localhost:3306/world?useSSL=false&serverTimezone=UTC 10 | root 11 | 12345 12 | 1 13 | thread 14 | true 15 | org.hibernate.dialect.MySQLDialect 16 | 17 | -------------------------------------------------------------------------------- /4 - mavenIntro/intro/.classpath: -------------------------------------------------------------------------------- 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 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /4 - mavenIntro/intro/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | -------------------------------------------------------------------------------- /4 - mavenIntro/intro/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | intro 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.m2e.core.maven2Nature 22 | 23 | 24 | -------------------------------------------------------------------------------- /4 - mavenIntro/intro/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/test/java=UTF-8 4 | encoding/=UTF-8 5 | -------------------------------------------------------------------------------- /4 - mavenIntro/intro/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 3 | org.eclipse.jdt.core.compiler.compliance=11 4 | org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled 5 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 6 | org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore 7 | org.eclipse.jdt.core.compiler.release=disabled 8 | org.eclipse.jdt.core.compiler.source=11 9 | -------------------------------------------------------------------------------- /4 - mavenIntro/intro/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /4 - mavenIntro/intro/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | com.icanerdogan 8 | intro 9 | 0.0.1-SNAPSHOT 10 | 11 | intro 12 | 13 | http://www.example.com 14 | 15 | 16 | UTF-8 17 | 1.16 18 | 1.16 19 | 20 | 21 | 22 | 23 | 24 | 25 | org.hibernate 26 | hibernate-core 27 | 5.4.31.Final 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | maven-clean-plugin 38 | 3.1.0 39 | 40 | 41 | 42 | maven-resources-plugin 43 | 3.0.2 44 | 45 | 46 | maven-compiler-plugin 47 | 3.8.0 48 | 49 | 50 | maven-surefire-plugin 51 | 2.22.1 52 | 53 | 54 | maven-jar-plugin 55 | 3.0.2 56 | 57 | 58 | maven-install-plugin 59 | 2.5.2 60 | 61 | 62 | maven-deploy-plugin 63 | 2.8.2 64 | 65 | 66 | 67 | maven-site-plugin 68 | 3.7.1 69 | 70 | 71 | maven-project-info-reports-plugin 72 | 3.0.0 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /4 - mavenIntro/intro/src/main/java/com/icanerdogan/intro/App.java: -------------------------------------------------------------------------------- 1 | package com.icanerdogan.intro; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | public static void main( String[] args ) 10 | { 11 | System.out.println( "Hello World!" ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /4 - mavenIntro/intro/src/test/java/com/icanerdogan/intro/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.icanerdogan.intro; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | { 12 | /** 13 | * Rigorous Test :-) 14 | */ 15 | @Test 16 | public void shouldAnswerWithTrue() 17 | { 18 | assertTrue( true ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /5 - springBootDemo/springBootDemo/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /5 - springBootDemo/springBootDemo/.mvn/wrapper/MavenWrapperDownloader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-present 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 | * https://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 | import java.net.*; 17 | import java.io.*; 18 | import java.nio.channels.*; 19 | import java.util.Properties; 20 | 21 | public class MavenWrapperDownloader { 22 | 23 | private static final String WRAPPER_VERSION = "0.5.6"; 24 | /** 25 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. 26 | */ 27 | private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" 28 | + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; 29 | 30 | /** 31 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to 32 | * use instead of the default one. 33 | */ 34 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH = 35 | ".mvn/wrapper/maven-wrapper.properties"; 36 | 37 | /** 38 | * Path where the maven-wrapper.jar will be saved to. 39 | */ 40 | private static final String MAVEN_WRAPPER_JAR_PATH = 41 | ".mvn/wrapper/maven-wrapper.jar"; 42 | 43 | /** 44 | * Name of the property which should be used to override the default download url for the wrapper. 45 | */ 46 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; 47 | 48 | public static void main(String args[]) { 49 | System.out.println("- Downloader started"); 50 | File baseDirectory = new File(args[0]); 51 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); 52 | 53 | // If the maven-wrapper.properties exists, read it and check if it contains a custom 54 | // wrapperUrl parameter. 55 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); 56 | String url = DEFAULT_DOWNLOAD_URL; 57 | if(mavenWrapperPropertyFile.exists()) { 58 | FileInputStream mavenWrapperPropertyFileInputStream = null; 59 | try { 60 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); 61 | Properties mavenWrapperProperties = new Properties(); 62 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); 63 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); 64 | } catch (IOException e) { 65 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); 66 | } finally { 67 | try { 68 | if(mavenWrapperPropertyFileInputStream != null) { 69 | mavenWrapperPropertyFileInputStream.close(); 70 | } 71 | } catch (IOException e) { 72 | // Ignore ... 73 | } 74 | } 75 | } 76 | System.out.println("- Downloading from: " + url); 77 | 78 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); 79 | if(!outputFile.getParentFile().exists()) { 80 | if(!outputFile.getParentFile().mkdirs()) { 81 | System.out.println( 82 | "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); 83 | } 84 | } 85 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); 86 | try { 87 | downloadFileFromURL(url, outputFile); 88 | System.out.println("Done"); 89 | System.exit(0); 90 | } catch (Throwable e) { 91 | System.out.println("- Error downloading"); 92 | e.printStackTrace(); 93 | System.exit(1); 94 | } 95 | } 96 | 97 | private static void downloadFileFromURL(String urlString, File destination) throws Exception { 98 | if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { 99 | String username = System.getenv("MVNW_USERNAME"); 100 | char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); 101 | Authenticator.setDefault(new Authenticator() { 102 | @Override 103 | protected PasswordAuthentication getPasswordAuthentication() { 104 | return new PasswordAuthentication(username, password); 105 | } 106 | }); 107 | } 108 | URL website = new URL(urlString); 109 | ReadableByteChannel rbc; 110 | rbc = Channels.newChannel(website.openStream()); 111 | FileOutputStream fos = new FileOutputStream(destination); 112 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); 113 | fos.close(); 114 | rbc.close(); 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /5 - springBootDemo/springBootDemo/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/5 - springBootDemo/springBootDemo/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /5 - springBootDemo/springBootDemo/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /5 - springBootDemo/springBootDemo/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Mingw, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | fi 118 | 119 | if [ -z "$JAVA_HOME" ]; then 120 | javaExecutable="`which javac`" 121 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 122 | # readlink(1) is not available as standard on Solaris 10. 123 | readLink=`which readlink` 124 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 125 | if $darwin ; then 126 | javaHome="`dirname \"$javaExecutable\"`" 127 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 128 | else 129 | javaExecutable="`readlink -f \"$javaExecutable\"`" 130 | fi 131 | javaHome="`dirname \"$javaExecutable\"`" 132 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 133 | JAVA_HOME="$javaHome" 134 | export JAVA_HOME 135 | fi 136 | fi 137 | fi 138 | 139 | if [ -z "$JAVACMD" ] ; then 140 | if [ -n "$JAVA_HOME" ] ; then 141 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 142 | # IBM's JDK on AIX uses strange locations for the executables 143 | JAVACMD="$JAVA_HOME/jre/sh/java" 144 | else 145 | JAVACMD="$JAVA_HOME/bin/java" 146 | fi 147 | else 148 | JAVACMD="`which java`" 149 | fi 150 | fi 151 | 152 | if [ ! -x "$JAVACMD" ] ; then 153 | echo "Error: JAVA_HOME is not defined correctly." >&2 154 | echo " We cannot execute $JAVACMD" >&2 155 | exit 1 156 | fi 157 | 158 | if [ -z "$JAVA_HOME" ] ; then 159 | echo "Warning: JAVA_HOME environment variable is not set." 160 | fi 161 | 162 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 163 | 164 | # traverses directory structure from process work directory to filesystem root 165 | # first directory with .mvn subdirectory is considered project base directory 166 | find_maven_basedir() { 167 | 168 | if [ -z "$1" ] 169 | then 170 | echo "Path not specified to find_maven_basedir" 171 | return 1 172 | fi 173 | 174 | basedir="$1" 175 | wdir="$1" 176 | while [ "$wdir" != '/' ] ; do 177 | if [ -d "$wdir"/.mvn ] ; then 178 | basedir=$wdir 179 | break 180 | fi 181 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 182 | if [ -d "${wdir}" ]; then 183 | wdir=`cd "$wdir/.."; pwd` 184 | fi 185 | # end of workaround 186 | done 187 | echo "${basedir}" 188 | } 189 | 190 | # concatenates all lines of a file 191 | concat_lines() { 192 | if [ -f "$1" ]; then 193 | echo "$(tr -s '\n' ' ' < "$1")" 194 | fi 195 | } 196 | 197 | BASE_DIR=`find_maven_basedir "$(pwd)"` 198 | if [ -z "$BASE_DIR" ]; then 199 | exit 1; 200 | fi 201 | 202 | ########################################################################################## 203 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 204 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 205 | ########################################################################################## 206 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 207 | if [ "$MVNW_VERBOSE" = true ]; then 208 | echo "Found .mvn/wrapper/maven-wrapper.jar" 209 | fi 210 | else 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 213 | fi 214 | if [ -n "$MVNW_REPOURL" ]; then 215 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 216 | else 217 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 218 | fi 219 | while IFS="=" read key value; do 220 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 221 | esac 222 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 223 | if [ "$MVNW_VERBOSE" = true ]; then 224 | echo "Downloading from: $jarUrl" 225 | fi 226 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 227 | if $cygwin; then 228 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 229 | fi 230 | 231 | if command -v wget > /dev/null; then 232 | if [ "$MVNW_VERBOSE" = true ]; then 233 | echo "Found wget ... using wget" 234 | fi 235 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 236 | wget "$jarUrl" -O "$wrapperJarPath" 237 | else 238 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" 239 | fi 240 | elif command -v curl > /dev/null; then 241 | if [ "$MVNW_VERBOSE" = true ]; then 242 | echo "Found curl ... using curl" 243 | fi 244 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 245 | curl -o "$wrapperJarPath" "$jarUrl" -f 246 | else 247 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 248 | fi 249 | 250 | else 251 | if [ "$MVNW_VERBOSE" = true ]; then 252 | echo "Falling back to using Java to download" 253 | fi 254 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 255 | # For Cygwin, switch paths to Windows format before running javac 256 | if $cygwin; then 257 | javaClass=`cygpath --path --windows "$javaClass"` 258 | fi 259 | if [ -e "$javaClass" ]; then 260 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 261 | if [ "$MVNW_VERBOSE" = true ]; then 262 | echo " - Compiling MavenWrapperDownloader.java ..." 263 | fi 264 | # Compiling the Java class 265 | ("$JAVA_HOME/bin/javac" "$javaClass") 266 | fi 267 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 268 | # Running the downloader 269 | if [ "$MVNW_VERBOSE" = true ]; then 270 | echo " - Running MavenWrapperDownloader.java ..." 271 | fi 272 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 273 | fi 274 | fi 275 | fi 276 | fi 277 | ########################################################################################## 278 | # End of extension 279 | ########################################################################################## 280 | 281 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 282 | if [ "$MVNW_VERBOSE" = true ]; then 283 | echo $MAVEN_PROJECTBASEDIR 284 | fi 285 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 286 | 287 | # For Cygwin, switch paths to Windows format before running java 288 | if $cygwin; then 289 | [ -n "$M2_HOME" ] && 290 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 291 | [ -n "$JAVA_HOME" ] && 292 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 293 | [ -n "$CLASSPATH" ] && 294 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 295 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 296 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 297 | fi 298 | 299 | # Provide a "standardized" way to retrieve the CLI args that will 300 | # work with both Windows and non-Windows executions. 301 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 302 | export MAVEN_CMD_LINE_ARGS 303 | 304 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 305 | 306 | exec "$JAVACMD" \ 307 | $MAVEN_OPTS \ 308 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 309 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 310 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 311 | -------------------------------------------------------------------------------- /5 - springBootDemo/springBootDemo/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /5 - springBootDemo/springBootDemo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.5 9 | 10 | 11 | com.icanerdogan 12 | springBootDemo 13 | 0.0.1-SNAPSHOT 14 | springBootDemo 15 | Demo project for Spring Boot 16 | 17 | 16 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-web 23 | 24 | 25 | 26 | org.springframework.boot 27 | spring-boot-starter-test 28 | test 29 | 30 | 31 | 32 | org.springframework.boot 33 | spring-boot-devtools 34 | 35 | 36 | 37 | 38 | 39 | 40 | org.springframework.boot 41 | spring-boot-maven-plugin 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /5 - springBootDemo/springBootDemo/src/main/java/com/icanerdogan/springBootDemo/SpringBootDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.icanerdogan.springBootDemo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootDemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootDemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /5 - springBootDemo/springBootDemo/src/main/java/com/icanerdogan/springBootDemo/apiDemo/ProductsController.java: -------------------------------------------------------------------------------- 1 | package com.icanerdogan.springBootDemo.apiDemo; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | // Controllerde class sınıflandırması çoğul yapılır! 7 | @RestController 8 | public class ProductsController { 9 | // MVC 10 | // Model: View-Controller veya Controller-View arası gönderilecek data transferi model ile yapılır. 11 | // View: Controllerdan aldığı görüntüyü, isteği view'a yönlendirir. 12 | // Controller: Kullanıcı tarafından isteneni ilk karşılayan kısımdır. İsteğin nasıl yanıtlanacağına karar verir. 13 | 14 | @GetMapping("/") // Bu kod satırında tek "/" varsa ana ekranımızı belirliyor! 15 | public String get() { 16 | return "Ana ekran"; 17 | } 18 | 19 | @GetMapping("/products") // Artık "localhost:8080/products" şeklinde bir adres eklenmiş oldu! 20 | public String get2() { 21 | return "products sekmesi"; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /5 - springBootDemo/springBootDemo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /5 - springBootDemo/springBootDemo/src/test/java/com/icanerdogan/springBootDemo/SpringBootDemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.icanerdogan.springBootDemo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringBootDemoApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /6 - hibernateAndJpa/hibernateAndJpa/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /6 - hibernateAndJpa/hibernateAndJpa/.mvn/wrapper/MavenWrapperDownloader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-present 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 | * https://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 | import java.net.*; 17 | import java.io.*; 18 | import java.nio.channels.*; 19 | import java.util.Properties; 20 | 21 | public class MavenWrapperDownloader { 22 | 23 | private static final String WRAPPER_VERSION = "0.5.6"; 24 | /** 25 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. 26 | */ 27 | private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" 28 | + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; 29 | 30 | /** 31 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to 32 | * use instead of the default one. 33 | */ 34 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH = 35 | ".mvn/wrapper/maven-wrapper.properties"; 36 | 37 | /** 38 | * Path where the maven-wrapper.jar will be saved to. 39 | */ 40 | private static final String MAVEN_WRAPPER_JAR_PATH = 41 | ".mvn/wrapper/maven-wrapper.jar"; 42 | 43 | /** 44 | * Name of the property which should be used to override the default download url for the wrapper. 45 | */ 46 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; 47 | 48 | public static void main(String args[]) { 49 | System.out.println("- Downloader started"); 50 | File baseDirectory = new File(args[0]); 51 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); 52 | 53 | // If the maven-wrapper.properties exists, read it and check if it contains a custom 54 | // wrapperUrl parameter. 55 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); 56 | String url = DEFAULT_DOWNLOAD_URL; 57 | if(mavenWrapperPropertyFile.exists()) { 58 | FileInputStream mavenWrapperPropertyFileInputStream = null; 59 | try { 60 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); 61 | Properties mavenWrapperProperties = new Properties(); 62 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); 63 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); 64 | } catch (IOException e) { 65 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); 66 | } finally { 67 | try { 68 | if(mavenWrapperPropertyFileInputStream != null) { 69 | mavenWrapperPropertyFileInputStream.close(); 70 | } 71 | } catch (IOException e) { 72 | // Ignore ... 73 | } 74 | } 75 | } 76 | System.out.println("- Downloading from: " + url); 77 | 78 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); 79 | if(!outputFile.getParentFile().exists()) { 80 | if(!outputFile.getParentFile().mkdirs()) { 81 | System.out.println( 82 | "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); 83 | } 84 | } 85 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); 86 | try { 87 | downloadFileFromURL(url, outputFile); 88 | System.out.println("Done"); 89 | System.exit(0); 90 | } catch (Throwable e) { 91 | System.out.println("- Error downloading"); 92 | e.printStackTrace(); 93 | System.exit(1); 94 | } 95 | } 96 | 97 | private static void downloadFileFromURL(String urlString, File destination) throws Exception { 98 | if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { 99 | String username = System.getenv("MVNW_USERNAME"); 100 | char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); 101 | Authenticator.setDefault(new Authenticator() { 102 | @Override 103 | protected PasswordAuthentication getPasswordAuthentication() { 104 | return new PasswordAuthentication(username, password); 105 | } 106 | }); 107 | } 108 | URL website = new URL(urlString); 109 | ReadableByteChannel rbc; 110 | rbc = Channels.newChannel(website.openStream()); 111 | FileOutputStream fos = new FileOutputStream(destination); 112 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); 113 | fos.close(); 114 | rbc.close(); 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /6 - hibernateAndJpa/hibernateAndJpa/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ibrahimcanerdogan/SpringTutorial-Beginners/2f1f0f537f22ca051b573d5a8c6476e7ce3438d9/6 - hibernateAndJpa/hibernateAndJpa/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /6 - hibernateAndJpa/hibernateAndJpa/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /6 - hibernateAndJpa/hibernateAndJpa/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Mingw, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | fi 118 | 119 | if [ -z "$JAVA_HOME" ]; then 120 | javaExecutable="`which javac`" 121 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 122 | # readlink(1) is not available as standard on Solaris 10. 123 | readLink=`which readlink` 124 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 125 | if $darwin ; then 126 | javaHome="`dirname \"$javaExecutable\"`" 127 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 128 | else 129 | javaExecutable="`readlink -f \"$javaExecutable\"`" 130 | fi 131 | javaHome="`dirname \"$javaExecutable\"`" 132 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 133 | JAVA_HOME="$javaHome" 134 | export JAVA_HOME 135 | fi 136 | fi 137 | fi 138 | 139 | if [ -z "$JAVACMD" ] ; then 140 | if [ -n "$JAVA_HOME" ] ; then 141 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 142 | # IBM's JDK on AIX uses strange locations for the executables 143 | JAVACMD="$JAVA_HOME/jre/sh/java" 144 | else 145 | JAVACMD="$JAVA_HOME/bin/java" 146 | fi 147 | else 148 | JAVACMD="`which java`" 149 | fi 150 | fi 151 | 152 | if [ ! -x "$JAVACMD" ] ; then 153 | echo "Error: JAVA_HOME is not defined correctly." >&2 154 | echo " We cannot execute $JAVACMD" >&2 155 | exit 1 156 | fi 157 | 158 | if [ -z "$JAVA_HOME" ] ; then 159 | echo "Warning: JAVA_HOME environment variable is not set." 160 | fi 161 | 162 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 163 | 164 | # traverses directory structure from process work directory to filesystem root 165 | # first directory with .mvn subdirectory is considered project base directory 166 | find_maven_basedir() { 167 | 168 | if [ -z "$1" ] 169 | then 170 | echo "Path not specified to find_maven_basedir" 171 | return 1 172 | fi 173 | 174 | basedir="$1" 175 | wdir="$1" 176 | while [ "$wdir" != '/' ] ; do 177 | if [ -d "$wdir"/.mvn ] ; then 178 | basedir=$wdir 179 | break 180 | fi 181 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 182 | if [ -d "${wdir}" ]; then 183 | wdir=`cd "$wdir/.."; pwd` 184 | fi 185 | # end of workaround 186 | done 187 | echo "${basedir}" 188 | } 189 | 190 | # concatenates all lines of a file 191 | concat_lines() { 192 | if [ -f "$1" ]; then 193 | echo "$(tr -s '\n' ' ' < "$1")" 194 | fi 195 | } 196 | 197 | BASE_DIR=`find_maven_basedir "$(pwd)"` 198 | if [ -z "$BASE_DIR" ]; then 199 | exit 1; 200 | fi 201 | 202 | ########################################################################################## 203 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 204 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 205 | ########################################################################################## 206 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 207 | if [ "$MVNW_VERBOSE" = true ]; then 208 | echo "Found .mvn/wrapper/maven-wrapper.jar" 209 | fi 210 | else 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 213 | fi 214 | if [ -n "$MVNW_REPOURL" ]; then 215 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 216 | else 217 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 218 | fi 219 | while IFS="=" read key value; do 220 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 221 | esac 222 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 223 | if [ "$MVNW_VERBOSE" = true ]; then 224 | echo "Downloading from: $jarUrl" 225 | fi 226 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 227 | if $cygwin; then 228 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 229 | fi 230 | 231 | if command -v wget > /dev/null; then 232 | if [ "$MVNW_VERBOSE" = true ]; then 233 | echo "Found wget ... using wget" 234 | fi 235 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 236 | wget "$jarUrl" -O "$wrapperJarPath" 237 | else 238 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" 239 | fi 240 | elif command -v curl > /dev/null; then 241 | if [ "$MVNW_VERBOSE" = true ]; then 242 | echo "Found curl ... using curl" 243 | fi 244 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 245 | curl -o "$wrapperJarPath" "$jarUrl" -f 246 | else 247 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 248 | fi 249 | 250 | else 251 | if [ "$MVNW_VERBOSE" = true ]; then 252 | echo "Falling back to using Java to download" 253 | fi 254 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 255 | # For Cygwin, switch paths to Windows format before running javac 256 | if $cygwin; then 257 | javaClass=`cygpath --path --windows "$javaClass"` 258 | fi 259 | if [ -e "$javaClass" ]; then 260 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 261 | if [ "$MVNW_VERBOSE" = true ]; then 262 | echo " - Compiling MavenWrapperDownloader.java ..." 263 | fi 264 | # Compiling the Java class 265 | ("$JAVA_HOME/bin/javac" "$javaClass") 266 | fi 267 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 268 | # Running the downloader 269 | if [ "$MVNW_VERBOSE" = true ]; then 270 | echo " - Running MavenWrapperDownloader.java ..." 271 | fi 272 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 273 | fi 274 | fi 275 | fi 276 | fi 277 | ########################################################################################## 278 | # End of extension 279 | ########################################################################################## 280 | 281 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 282 | if [ "$MVNW_VERBOSE" = true ]; then 283 | echo $MAVEN_PROJECTBASEDIR 284 | fi 285 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 286 | 287 | # For Cygwin, switch paths to Windows format before running java 288 | if $cygwin; then 289 | [ -n "$M2_HOME" ] && 290 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 291 | [ -n "$JAVA_HOME" ] && 292 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 293 | [ -n "$CLASSPATH" ] && 294 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 295 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 296 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 297 | fi 298 | 299 | # Provide a "standardized" way to retrieve the CLI args that will 300 | # work with both Windows and non-Windows executions. 301 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 302 | export MAVEN_CMD_LINE_ARGS 303 | 304 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 305 | 306 | exec "$JAVACMD" \ 307 | $MAVEN_OPTS \ 308 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 309 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 310 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 311 | -------------------------------------------------------------------------------- /6 - hibernateAndJpa/hibernateAndJpa/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /6 - hibernateAndJpa/hibernateAndJpa/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.5 9 | 10 | 11 | com.icanerdogan 12 | hibernateAndJpa 13 | 0.0.1-SNAPSHOT 14 | hibernateAndJpa 15 | Demo project for Spring Boot 16 | 17 | 16 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-web 23 | 24 | 25 | 26 | org.springframework.boot 27 | spring-boot-starter-test 28 | test 29 | 30 | 31 | 32 | 33 | org.springframework.boot 34 | spring-boot-starter-data-jpa 35 | 36 | 37 | 38 | mysql 39 | mysql-connector-java 40 | 8.0.23 41 | 42 | 43 | 44 | 45 | 46 | 47 | org.springframework.boot 48 | spring-boot-maven-plugin 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /6 - hibernateAndJpa/hibernateAndJpa/src/main/java/com/icanerdogan/hibernateAndJpa/Business/Abstracts/CityService.java: -------------------------------------------------------------------------------- 1 | package com.icanerdogan.hibernateAndJpa.Business.Abstracts; 2 | 3 | import java.util.List; 4 | 5 | import com.icanerdogan.hibernateAndJpa.Entities.City; 6 | 7 | public interface CityService { 8 | List getAll(); 9 | void add(City city); 10 | void update(City city); 11 | void delete(City city); 12 | City getById(int id); 13 | } 14 | -------------------------------------------------------------------------------- /6 - hibernateAndJpa/hibernateAndJpa/src/main/java/com/icanerdogan/hibernateAndJpa/Business/Concretes/CityManager.java: -------------------------------------------------------------------------------- 1 | package com.icanerdogan.hibernateAndJpa.Business.Concretes; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | import org.springframework.transaction.annotation.Transactional; 8 | 9 | import com.icanerdogan.hibernateAndJpa.Business.Abstracts.CityService; 10 | import com.icanerdogan.hibernateAndJpa.DataAccess.Abstracts.CityDal; 11 | import com.icanerdogan.hibernateAndJpa.Entities.City; 12 | 13 | @Service // Bunun bir iş katmanı olduğunu belirten etiketi ekliyoruz! 14 | public class CityManager implements CityService{ 15 | 16 | private CityDal cityDal; 17 | 18 | @Autowired // Constructor injectionlar için "Autowired" kullanılır 19 | public CityManager(CityDal cityDal) { 20 | this.cityDal = cityDal; 21 | } 22 | 23 | 24 | @Override 25 | @Transactional 26 | public List getAll() { 27 | return this.cityDal.getAll(); 28 | } 29 | 30 | @Override 31 | @Transactional 32 | public void add(City city) { 33 | // Burada bu sınıftaki dğer katmanlarda olduğu gibi iş fonskiyonları yazılır! 34 | // Meseala bu fonskiyonda şehir eklenirken istenen bir şart yazılır! 35 | this.cityDal.add(city); 36 | 37 | } 38 | 39 | @Override 40 | @Transactional 41 | public void update(City city) { 42 | this.cityDal.update(city); 43 | 44 | } 45 | 46 | @Override 47 | @Transactional 48 | public void delete(City city) { 49 | this.cityDal.delete(city); 50 | 51 | } 52 | 53 | 54 | @Override 55 | @Transactional 56 | public City getById(int id) { 57 | return this.cityDal.getById(id); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /6 - hibernateAndJpa/hibernateAndJpa/src/main/java/com/icanerdogan/hibernateAndJpa/DataAccess/Abstracts/CityDal.java: -------------------------------------------------------------------------------- 1 | package com.icanerdogan.hibernateAndJpa.DataAccess.Abstracts; 2 | import java.util.List; 3 | 4 | // City sınıfını kullanmak için sınıfı import ediyoruz. 5 | import com.icanerdogan.hibernateAndJpa.Entities.City; 6 | 7 | public interface CityDal { 8 | List getAll(); 9 | void add(City city); 10 | void update(City city); 11 | void delete(City city); 12 | City getById(int id); 13 | } 14 | -------------------------------------------------------------------------------- /6 - hibernateAndJpa/hibernateAndJpa/src/main/java/com/icanerdogan/hibernateAndJpa/DataAccess/Concretes/HibernateCityDal.java: -------------------------------------------------------------------------------- 1 | package com.icanerdogan.hibernateAndJpa.DataAccess.Concretes; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.EntityManager; 6 | 7 | 8 | import org.hibernate.Session; 9 | 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Repository; 12 | import org.springframework.transaction.annotation.Transactional; 13 | 14 | import com.icanerdogan.hibernateAndJpa.DataAccess.Abstracts.CityDal; 15 | import com.icanerdogan.hibernateAndJpa.Entities.City; 16 | 17 | @Repository // CityDal implementasyonunu kullanması için gereklidir! 18 | // Bu etiketi bu sınıfı kullanmaya başladığımızda siliyoruz ve kullanacağımız sınıfa ekliyoruz! 19 | public class HibernateCityDal implements CityDal{ 20 | 21 | private EntityManager entityManager; 22 | 23 | @Autowired 24 | public HibernateCityDal(EntityManager entityManager) { 25 | super(); 26 | this.entityManager = entityManager; 27 | } 28 | 29 | @Override 30 | @Transactional // AOP - Aspect Oriented Programming 31 | public List getAll() { 32 | Session session = entityManager.unwrap(Session.class); 33 | 34 | List cities = session.createQuery("from City", City.class).getResultList(); 35 | 36 | return cities; 37 | } 38 | 39 | @Override 40 | public void add(City city) { 41 | Session session = entityManager.unwrap(Session.class); 42 | session.saveOrUpdate(city); 43 | 44 | } 45 | 46 | @Override 47 | public void update(City city) { 48 | Session session = entityManager.unwrap(Session.class); 49 | session.saveOrUpdate(city); 50 | } 51 | 52 | @Override 53 | public void delete(City city) { 54 | Session session = entityManager.unwrap(Session.class); 55 | 56 | City cityToDelete = session.get(City.class, city.getId()); 57 | 58 | session.delete(cityToDelete); 59 | 60 | } 61 | 62 | @Override 63 | public City getById(int id) { 64 | Session session = entityManager.unwrap(Session.class); 65 | 66 | City city = session.get(City.class, id); 67 | return city; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /6 - hibernateAndJpa/hibernateAndJpa/src/main/java/com/icanerdogan/hibernateAndJpa/Entities/City.java: -------------------------------------------------------------------------------- 1 | package com.icanerdogan.hibernateAndJpa.Entities; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Entity; 5 | import javax.persistence.GeneratedValue; 6 | import javax.persistence.GenerationType; 7 | import javax.persistence.Id; 8 | import javax.persistence.Table; 9 | 10 | // Veri tabanı işlemlerinde kullanacağımız sınıfımız 11 | @Entity 12 | @Table(name="city") 13 | public class City { 14 | @Id 15 | @Column(name="ID") 16 | @GeneratedValue(strategy = GenerationType.IDENTITY) // Üretilecek alan 17 | private int id; 18 | 19 | @Column(name="name") 20 | private String name; 21 | 22 | @Column(name="countrycode") 23 | private String countryCode; 24 | 25 | @Column(name="district") 26 | private String district; 27 | 28 | @Column(name="population") 29 | private int population; 30 | 31 | public City(int id, String name, String countryCode, String district, int population) { 32 | super(); 33 | this.id = id; 34 | this.name = name; 35 | this.countryCode = countryCode; 36 | this.district = district; 37 | this.population = population; 38 | } 39 | 40 | public City() {} 41 | 42 | public int getId() { 43 | return id; 44 | } 45 | 46 | public void setId(int id) { 47 | this.id = id; 48 | } 49 | 50 | public String getName() { 51 | return name; 52 | } 53 | 54 | public void setName(String name) { 55 | this.name = name; 56 | } 57 | 58 | public String getCountryCode() { 59 | return countryCode; 60 | } 61 | 62 | public void setCountryCode(String countryCode) { 63 | this.countryCode = countryCode; 64 | } 65 | 66 | public String getDistrict() { 67 | return district; 68 | } 69 | 70 | public void setDistrict(String district) { 71 | this.district = district; 72 | } 73 | 74 | public int getPopulation() { 75 | return population; 76 | } 77 | 78 | public void setPopulation(int population) { 79 | this.population = population; 80 | } 81 | 82 | 83 | } 84 | -------------------------------------------------------------------------------- /6 - hibernateAndJpa/hibernateAndJpa/src/main/java/com/icanerdogan/hibernateAndJpa/HibernateAndJpaApplication.java: -------------------------------------------------------------------------------- 1 | package com.icanerdogan.hibernateAndJpa; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class HibernateAndJpaApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(HibernateAndJpaApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /6 - hibernateAndJpa/hibernateAndJpa/src/main/java/com/icanerdogan/hibernateAndJpa/restApi/CityController.java: -------------------------------------------------------------------------------- 1 | //application.properties dosyasına gerekli eklemeleri yapmayı unutma!!! 2 | 3 | package com.icanerdogan.hibernateAndJpa.restApi; 4 | import com.icanerdogan.hibernateAndJpa.Entities.City; 5 | 6 | import java.util.List; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.PathVariable; 11 | import org.springframework.web.bind.annotation.PostMapping; 12 | import org.springframework.web.bind.annotation.RequestBody; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | import org.springframework.web.bind.annotation.RestController; 15 | 16 | import com.icanerdogan.hibernateAndJpa.Business.Abstracts.CityService; 17 | 18 | // Arayüz işlemleri restApi sınıfında yapılır 19 | 20 | @RestController 21 | @RequestMapping("/api") 22 | public class CityController { 23 | //Api katmanına eklediğimiz ve haberleştiğimiz katman Bussiness katmanı! 24 | private CityService cityService; 25 | 26 | @Autowired // Hızlı Injection 27 | public CityController(CityService cityService) { 28 | super(); 29 | this.cityService = cityService; 30 | } 31 | 32 | @GetMapping("/cities") 33 | public List get(){ 34 | return cityService.getAll(); 35 | } 36 | 37 | @PostMapping("/add") // Kullanıcıdan işlemlerde 38 | public void add(@RequestBody City city) { 39 | cityService.add(city); 40 | } 41 | 42 | @PostMapping("/update") 43 | public void update(@RequestBody City city) { 44 | cityService.update(city); 45 | } 46 | 47 | @PostMapping("/delete") 48 | public void delete(@RequestBody City city) { 49 | cityService.delete(city); 50 | } 51 | 52 | @GetMapping("/cities/{id}") 53 | public City getById(@PathVariable int id){ 54 | return cityService.getById(id); 55 | } 56 | } 57 | 58 | -------------------------------------------------------------------------------- /6 - hibernateAndJpa/hibernateAndJpa/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 2 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect 3 | spring.jpa.show-sql=true 4 | spring.jpa.hibernate.ddl-auto=update 5 | 6 | spring.datasource.url=jdbc:mysql://localhost:3306/world?useSSL=false&serverTimezone=UTC&useLegacyDatetimeCode=false 7 | spring.datasource.username=root 8 | spring.datasource.password=12345 9 | 10 | 11 | server.port=8082 -------------------------------------------------------------------------------- /6 - hibernateAndJpa/hibernateAndJpa/src/test/java/com/icanerdogan/hibernateAndJpa/HibernateAndJpaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.icanerdogan.hibernateAndJpa; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class HibernateAndJpaApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Spring Tutorial for Beginners

2 | 3 | ![GitHub last commit](https://img.shields.io/github/last-commit/icanerdogan/SpringTutorial-Beginners?style=flat-square) 4 | ![GitHub Repo stars](https://img.shields.io/github/stars/icanerdogan/SpringTutorial-Beginners?logo=Github&style=flat-square) 5 | ![GitHub followers](https://img.shields.io/github/followers/icanerdogan?color=yellow&logo=Github&style=flat-square) 6 | 7 |

File Directory

8 | 29 | 30 |
31 |

Apache Tomcat

32 |

Apache Tomcat, Apache Yazılım Vakfı tarafından geliştirilmiş açık kaynak bir Java Servlet Container uygulamasıdır.

33 | 34 |

Kurulum

35 |
    36 |
  1. https://tomcat.apache.org sitesine gidin. Sol tarafta "Download" altındaki kısımında, son sürüme tıklayın.

  2. 37 |
  3. Çıkan ekranda işletim sisteminize ve sürümünüze en uygun seçeneği seçin ve indirme işlemi başlayacaktır.

  4. 38 |
  5. Uygulamamızın kurulumuna devam ederken, aşağıda görülen ekranda "Full" kurulumu seçmeyi unutmayın!

  6. 39 |
  7. "Configuration" ekranında Port numaralarımızı aşağıdaki gibi veriyoruz. User Name alanına kullanıcı adımızı "admin" olarak, Password alanına şifremizi "12345" olarak belirliyoruz.

  8. "Java Virtual Machine" ekranında gereken JDK dosyamızın dizinini veriyoruz. Burada JDK 11 sürümünü de kullanabilirsiniz!
    41 |
  9. Programımızın kurulacağı dosya dizinini de aşağıdaki gibi veriyoruz!

  10. 42 |
  11. Kurulum bittikten sonra "localhost:8080" adresine gittiğinizde karşınıza aşağıdaki web site çıkacktır. Karşınıza bu ekran geliyorsa kurulumunuz başarıyla tamamlanmıştır!

  12. 43 |
44 | 45 |
46 | 47 |

Apache Tomcat - Eclipse Bağlantısı

48 |

Kurulum

49 |
    50 |
  1. Eclipse IDE Programımızı açıyoruz.

  2. 51 |
  3. File > New > Other kısmına tıklıyoruz!

  4. 52 |
  5. Karşımıza gelen ekranda "server" yazıp gelen "Server" seçeneğine tıklayıp, Next diyoruz!

  6. 53 |
  7. Tekrardan karşımıza çıkan ekranda arama kutucuğuna "apache" yazıyoruz ve son sürümünü (10) kurduğumuz için "Tomcat v10.0 Server" seceneğine tıklayıp Next diyoruz!

  8. 54 |
  9. Bu ekranda Tomcat'i bilgisayarımıza kurduğumuz dizini giriyoruz!

  10. 55 |
  11. Finish ile kurulumu bitirebiliriz.

  12. 56 |
  13. Eğer Eclipse IDE uygulamanızda Alt barda "Servers" yok ise bunu aşağıdaki adımları izleyerek ekleyebilirsiniz.

  14. 57 |
  15. Window > Show View > Other kısmına tıklıyoruz!

  16. 58 |
  17. Buradan Server > Servers altında "Servers" seceneğine tıklayıp, Open butonuna basıyoruz!

  18. 59 |
60 | 61 |
62 | 63 |

Spring Paketlerinin İndirilmesi ve Projeye Entegrasyonu

64 |

Kurulum

65 | 66 |
    67 |
  1. https://repo.spring.io/release/org/springframework/spring/ Bu adresten sayfanın en altından en güncel spring sürümünü seçiyoruz!


  2. 68 |
  3. Tıkladığımızda karşımıza gelen ekranda "-dist.zip" isimli dosyayı indiriyoruz!


  4. 69 |
  5. İndirilen dosyayı klasörden çıkarıldığında "libs" klasörü içindeki tüm jar dosyalarını kopyalıyoruz!


  6. 70 |
  7. Eclipse uygulamamızı açıp istediğiniz dizinde "springIntro" adından java projesi oluşturuyoruz.


  8. 71 |
  9. Projemize sağ tıklayıp New > Folder kısmına gidiyoruz!


  10. 72 |
  11. Karşımıza gelen ekranda "libs" olarak belirlediğimiz dosyamızın adını giriyoruz!


  12. 73 |
  13. Tekrar projemize sağ tıklayıp en alt kısımda bulunan "Properties" alanına tıklıyoruz!


  14. 74 |
  15. Karşımıza çıkan bu ekranda "Libraries" sekmesine gelip "Classpath"e bir kez tıklıyoruz. Yanda bulunan "Add JARs..." alanına tıklıyoruz!


  16. 75 |
  17. Gelen ekranda açtığımız "libs" klasörünü bulup tüm Jar dosyalarını seçiyoruz! (Shift ile ilk jar dosyasına tıklayıp ardından son jar dosyasına tıklarsanız tüm Jar dosyalarını tek seferde seçebilirsiniz!)


  18. 76 |
  19. "OK" tuşuna bastıktan sonra "Apply and Close" ile ekranı kapatıp, projemizi başarıyla hazırlamış oluyoruz!

  20. 77 |
78 | 79 |
80 | 81 |

Hibernate

82 |

Hibernate, veritabanınızdaki tablolar ile classlar ile eşleştirip, class üzerinden veritabanındaki nesneleri ilişkilendirerek "insert", "update", "delete" ve "select" yapabilmemizi sağlıyor. 83 | JDBC ile yapılan tüm veritabanı sorgularını tamamen hibernate ile "generate" olarak yapılıyor.

84 |

Kurulum

85 | 86 |
    87 |
  1. https://hibernate.org/orm/releases/5.4/ adresine gidin ve görseldeki butona tıklayın! Açılan "SourceForge" penceresinde indirme otomatik olarak başlayacaktır.

  2. 88 |
  3. Eğer bilgisayarınızda MySQL yoksa https://dev.mysql.com/downloads/windows/installer/8.0.html buradan indirmeniz, gerekiyor! Kurulum için detaylı bir kurulum videosu izlemenizi öneririm!

  4. 89 |
  5. Eclipse IDE'mize gelip "hibernateDemo" adında proje oluşturduktan sonra projeye sağ tıklayıp New > Folder!a tıklıyoruz.

  6. 90 |
  7. "libs" adında bir klasör oluşturuyoruz!

  8. 91 |
  9. İndirdiğimiz hibernate klasörünü RAR'dan çıkardıktan sonra görseldeki uzantıya gidip JAR dosyalarnı kopyalıyoruz. Sonrasında projemizde oluşturduğumuz "libs" içine JAR dosyalarını yapıştırıyoruz!

  10. 92 |
  11. https://disk.yandex.com.tr/d/O5rimXX5yG0Shw Burada bulunan MySQL bağlantı JAR dosyasını da "libs" klasörü içine atıyoruz.

  12. 93 |
  13. "libs" klasörü içinde bulunan dosyaları tanımlamak için, projemize sağ tıklayıp "properties" kısmına giriyoruz!

  14. 94 |
  15. Çıkan ekranda gördüğünüz adımları takip ederek "ADD Jars..." butonuna tıklıyoruz.

  16. 95 |
  17. Son olarak "hibernateDemo" içindeki JAR dosyalarını ekleyip, Apply ve sonrasına Apply&Close ile ekranı kapatıyoruz!

  18. 96 |
97 | 98 | 99 |

Hibernate Proje Entegrasyonu

100 |

Kurulum

101 |
    102 |
  1. https://disk.yandex.com.tr/d/Hv0ybf55Y8Mh-A adresine gidin! "hibernate.cfg.xml" dosyasını indirin.

  2. 103 |
  3. "src" dosyası içine indirdiğiniz dosyayı yapıştırın!

  4. 104 |
  5. Dosya içinde "connection.url" kısmını veritabanı adınıza göre veriryoruz, yine kullanıcı adınızı ve şifrenizi veritabanınıza göre verin!

  6. 105 |
106 | 107 |
108 | 109 |

Maven

110 |

Büyük projelerde birçok Jar dosyaları vs. birçok kütüphaneden yararlanıyoruz. Proje devam ettikçe bu paket sayısı artarken, paketlere gelen güncellemelerde takip edilmesi gerekiyor.

111 |
    112 |
  • Jar dosyaları yönetilebilir.

  • 113 |
  • Proje şablonları ile standart proje yönetimlerini yapabilirsiniz.

  • 114 |
  • Versiyon takip sistemi de sunuyor.

  • 115 |
116 |

Biz projemize birşey eklediğimizde veya istediğimizde bunu maven ile yapıyoruz. Bu durumda maven bizim diğer kütüphaneler ile haberleşmeyi sağlıyor.

117 |

Hibernate, Spring gibi firmalar yaptıkları güncellemeleri Maven'a yükler, projeler de bu şekilde rahatlıkla güncellemeleri takip edebilir.

118 |

Kurulum

119 |
    120 |
  1. Öncelikle Help > Install New Software ile maven'ı projemize eklememiz gerekiyor!

  2. 121 |
  3. Çıkan ekranda Work with kısmına 122 | http://download.eclipse.org/technology/m2e/releases/ bu linki ekliyoruz ve "Add" butonua basıyoruz. "Group items by category" tikini kaldırıyoruz ve ekranda gördüğünüz "m2e" paketlerine tik koyuyoruz! Next diyip kurulumunu bitiriyoruz.

  4. 123 |
  5. Maven projesi oluşturmak için öncelikle File > New > Other'a tıklıyoruz!

  6. 124 |
  7. Gelen ekranda arama kısmına "maven" yazıyoruz ve "Maven Poject" kısmında tıklıyoruz. Next butonuna tıklayıp devam ediyoruz.

  8. 125 |
  9. Bu ekranda çalışma alanımızı istiyorsanız değiştirebilirsiniz ancak genelde deafult olarak devam edilir!

  10. 126 |
  11. Filter kısmında "maven-archetype-quickstart" yazıp alt tarafta işaretli olan paketi seçip Next diyip devam ediyoruz!

  12. 127 |
  13. Bu ekranda "Group Id" şirketimizin adı, "Artifact Id" ise oluşturacağımız projenin adıdır. Örnek olarak aşağıdaki gibi oluşturup Finish ile projemizi tamamlıyoruz!

  14. 128 |
  15. Oluşturduğumuz dosya içinde pom.xml dosyasında görüldü yere "1." yazısından sonra kullandığımız JDK sürümünü yazıyoruz. Örnek olarak ben JDK 16 sürümünü kullanıyorum.

  16. 129 |
  17. Projemiz başarıyla oluşturuldu!

  18. 130 |
131 | 132 |

Maven Projesine Kütüphane Entegrasyonu

133 |
    134 |
  1. https://mvnrepository.com adresine gidiyoruz. Bu sitede eklemek projenizde kullanmak istediğiniz kütüphanenizin "maven" içinde mevcut mu kontrol edebilirsiniz! Maven için olan dosyaları yine "dependency" kodlarıyla projenize rahatlıkla ekleyebilirsiniz! Arama kısmına projemize eklemek istediğimiz "hibernate" kütüphanesini yazıyoruz.

  2. 135 |
  3. Gelen ekranda en son final sürümünü seçebilirsiniz!

  4. 136 |
  5. İstediğiniz sürüme tıkladığınızda karşınıza "maven" dependency kod blokları gelecektir. Bu kod bloğunu kopyalıyoruz.

  6. 137 |
  7. pom.xml içine kod bloğumuzu aşağıdaki gibi eklememiz yeterlidir!

  8. 138 |
  9. Dilediğiniz tüm kütüphaneler için bu adımları uygulayabilirsiniz!
  10. 139 |
140 | 141 |
142 | 143 |

Spring Boot

144 | 145 |

Spring Boot : Giriş

146 |

Kurulum

147 |
    148 |
  1. https://start.spring.io adresine gidiyoruz. "Dependencies" kısmına Spring Web ekliyoruz. Buraya ekleyeceğimiz dosyaları sonradan pom.xml dosyamıza https://mvnrepository.com sitesinden istediğimiz kütüphanenin dependency kodlarını bularak ekleyebiliriz. Sonrasında "Group" ile şirket adımızı, "Artifact" ile projemizin adını veriyoruz. Java kısmı karşısında JDK sürümümüzü seçiyoruz. GENERATE butonuna tıklayın ve inen dosyası RAR içinden çıkarın!

  2. 149 |
  3. Eclipse içinde File > Import kısmına tıklıyoruz!

  4. 150 |
  5. Import ekranımızda karşımıza gelen arama kutucuğuna "maven" yazıp "Existing Maven Projects" seçiyoruz. Bu şekilde var olan bir maven projesini projemize eklemeyi amaçlıyoruz! Next diyoruz!

  6. 151 |
  7. Bu ekranda "Browse" seçeneğine tıklıyoruz! İndirdiğimiz ve RAR'dan çıkardığımız dosyamıza girip karşımıza "src" klasörünü görünceye kadar ilerliyoruz. OK butonnuna basın ve Projects altında "pom.xml" kısmı görüyorsanız doğru bir şekilde ilerlediğiniz anlamına geliyor!

  8. 152 |
  9. Finish ile projemizi eklemiş oluyoruz!

  10. 153 |
154 | 155 |

Spring Boot : Spring REST

156 |

Java ile Front-end(Angular, React, Vue, Mobil Uygulama) teknolojileriyle kullanıcıya buluşturulurken arka tarafta işin back-end teknolojisine Rest API denir. Burada Controller sınıfı Spring boot işlemlerinde @RestController sınıfımıza "Controller" özelliği kazandırır.

157 | 158 |

Spring Boot : Katmanlı Mimari

159 | 160 |

Data Access: Veri erişim katmanımızdır. Bu katmanda sadece ver erişim işlemleri yapılır. Temel JDBC, Spring Data, Hibernate kodları buraya yazılır. 161 | İsimlendirmelerinde DAL veya DAO kısaltmaları kullanılır. 162 | 163 | Business: İş kurallarının yazıldığı katmandır. Mesela ehliyet alacak biri direksiyon, sınavdan vs. gerekli notu almış mı diye kontrol ettiğimiz if'lerin olduğu katmandır. 164 | İsimlendirmelerde Service ile kullanılır. 165 | 166 | UI: Kullanıcı arayüzümüzdür. Burası Swing, Angular, Mobile ile kullanılır. 167 | 168 | Tüm bu katmanlar birbiriyle Interface aracılığıyla haberleşir. Haberleşme Data Access ile Business ve Business ile UI arasında olur. Data Access ile UI arasında bir haberleşme olamaz çünkü kullanıcı yaptığı bir işlem direkt olarak veritabanına eklenmesi mümkün değildir. Kullanıcı UI ile yaptığı değişiklikleri Business katmanı sorgulamasını, uygunluğunu kontrol eder.

169 |

Kurulum

170 |
    171 |
  1. Bu kısımda tarayıcı üzerinden projemizdeki ekleme, güncelleme, silme işlemleri için https://www.postman.com/downloads/ ekranından "Postman" uygulamasını indirmeniz gerekmektedir!

  2. 172 |
  3. "Port is already in use" hatası aldığınızda application.property dosyası içinden yaptığımız gibi port numarasını değiştirebilirsiniz!

  4. 173 |
  5. Postman uygulamamıza giriş yapıyoruz. File > New > HTTP Request içine giriyoruz. Yeni koleksiyon oluşturuyoruz ve "Request name" kısmına bir isim veriyoruz!

  6. 174 |
  7. http://localhost:8082/api/cities adresini GET ile yazıyoruz. Bu sayede tüm şehirlerimizi veritabanımızdan çekebiliyoruz. İsterseniz dosya formatını JSON olarak çekebilirsiniz! "Status: 200 OK" uyarısı işlemin başarıyla gerçekleştiğini gösterir!

  8. 175 |
  9. http://localhost:8082/api/cities/4094 adresine yine GET içinde yazıp SEND butonuna tıklıyoruz! Görüldüğü gibi projemizdeki tek bir şehri alma fonksiyonumuz çalıştırıyor!

  10. 176 |
  11. http://localhost:8082/api/add linkini POST içinde yazdığımızda Body > row kısmına girip istediğimiz özelliklere sahip şehrimizi giriyoruz! ID kısmını vermiyoruz bu şekilde GeneratedValue özelliği sayesinde bize ID kısmı otomaotik şekilde üretiliyor!

  12. 177 |
  13. http://localhost:8082/api/update linkini yine POST içinde yazıyoruz ve bu sefer güncellemek istediğimiz şehrin ID'sini veriyoruz bu şekilde verilen ID'nin olduğu şehrin tüm özellikleri yeniden değiştiriliyor!

  14. 178 |
  15. Burada "Port is already in use" hatası aldığımızında portumuzu 8083'e taşıyoruz! http://localhost:8083/api/delete linkini POST içinde Body > raw içine JSON formatında yazıyoruz burada girdiğimiz ID'ye sahip şehir siliniyor!

  16. 179 |
180 | 181 |

Umarım Faydalı Olmuştur, Çok teşekkür ederim!

182 | 183 |

Sosyal Medya Hesaplarım

184 |

LINKEDIN

185 |

YOUTUBE

186 |

GITHUB

187 |

MEDIUM

188 | --------------------------------------------------------------------------------