Yazılım.
CevapSitesi.com Beta!
Çözüm Noktası
Bu siteyi Facebook, Twitter, Google+ veya e-posta ile paylaşın.
| Sorular | Makaleler | Üyeler | Etiketler  | İletişim
Soru sormak ya da cevap vermek için;
giriş yapın veya üye olun.

Sosyal medya hesaplarınızla da giriş yapabilirsiniz.

0



localhost da mysql eklediğim bilgiler gelmiyor

  1. package com.snmz.KitapEvi.Entity;
  2.  
  3. import java.math.BigDecimal;
  4. import java.util.Date;
  5. import javax.persistence.Column;
  6. import javax.persistence.Entity;
  7. import javax.persistence.GeneratedValue;
  8. import javax.persistence.GenerationType;
  9. import javax.persistence.Id;
  10. import javax.persistence.JoinColumn;
  11. import javax.persistence.ManyToOne;
  12. import javax.persistence.Table;
  13.  
  14. import lombok.Getter;
  15. import lombok.Setter;
  16. import lombok.ToString;
  17.  
  18. @Entity
  19. @Table(name = "snmz_book")
  20. @Setter
  21. @Getter
  22. @ToString
  23. public class Kitap {
  24. @Id
  25. @GeneratedValue(strategy = GenerationType.IDENTITY)
  26. private Long id;
  27. @Column(name = "stok_kodu")
  28. private String stok_kodu;
  29. @Column(name = "adi")
  30. private String adi;
  31. @Column(name = "aciklama")
  32. private String aciklama;
  33. @Column(name = "birim_fiyat")
  34. private BigDecimal birim_fiyat;
  35. @Column(name = "image_url")
  36. private String image_url;
  37. @Column(name = "aktif")
  38. private Boolean aktif;
  39. @Column(name = "stoktaki_birimler")
  40. private int stoktaki_birimler;
  41. @Column(name = "tarih_oluşturuldu")
  42. private Date tarih_olusturuldu;
  43. @Column(name = "Son_güncelleme")
  44. private Date Son_güncelleme;
  45. @ManyToOne
  46. @JoinColumn(name = "category_id", nullable = false)
  47. private SnmzCategory category;
  48. }
--------------------

  1. package com.snmz.KitapEvi.Repository;
  2.  
  3. import org.springframework.data.jpa.repository.JpaRepository;
  4. import org.springframework.stereotype.Repository;
  5. import org.springframework.web.bind.annotation.CrossOrigin;
  6.  
  7. import com.snmz.KitapEvi.Entity.Kitap;
  8.  
  9. @CrossOrigin("http://localhost:4200")
  10. @Repository
  11. public interface KitapRepository extends JpaRepository < Kitap, Long > {
  12.  
  13. }
---------------------


  1. spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
  2. spring.datasource.url=jdbc:mysql://localhost:3306/kitapsales?useSSL=false&useUnicode=yes&characterEncoding=UTF-8&allowPublicKeyRetrieval=true&serverTimezone=UTC
  3. spring.datasource.username=root
  4. spring.datasource.password=190325
  5.  
  6. spring.jpa.show-sql=true
  7. spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
  8.  
  9. spring.data.rest.base-path=/api/v1
  10.  

----------------------------http://localhost:8080/api/v1/kitaps-------------
bilgiler gelmiyor gelmesi gerekliydi

  1. {
  2. "_embedded" : {
  3. "kitaps" : [ {
  4. "_links" : {
  5. "self" : {
  6. "href" : "http://localhost:8080/api/v1/kitaps/1"
  7. },
  8. "kitap" : {
  9. "href" : "http://localhost:8080/api/v1/kitaps/1"
  10. },
  11. "category" : {
  12. "href" : "http://localhost:8080/api/v1/kitaps/1/category"
  13. }
  14. }
  15. }, {
  16. "_links" : {
  17. "self" : {
  18. "href" : "http://localhost:8080/api/v1/kitaps/2"
  19. },
  20. "kitap" : {
  21. "href" : "http://localhost:8080/api/v1/kitaps/2"
  22. },
  23. "category" : {
  24. "href" : "http://localhost:8080/api/v1/kitaps/2/category"
  25. }
  26. }
  27. }, {
  28. "_links" : {
  29. "self" : {
  30. "href" : "http://localhost:8080/api/v1/kitaps/3"
  31. },
  32. "kitap" : {
  33. "href" : "http://localhost:8080/api/v1/kitaps/3"
  34. },
  35. "category" : {
  36. "href" : "http://localhost:8080/api/v1/kitaps/3/category"
  37. }
  38. }
  39. }, {
  40. "_links" : {
  41. "self" : {
  42. "href" : "http://localhost:8080/api/v1/kitaps/4"
  43. },
  44. "kitap" : {
  45. "href" : "http://localhost:8080/api/v1/kitaps/4"
  46. },
  47. "category" : {
  48. "href" : "http://localhost:8080/api/v1/kitaps/4/category"
  49. }
  50. }
  51. }, {
  52. "_links" : {
  53. "self" : {
  54. "href" : "http://localhost:8080/api/v1/kitaps/5"
  55. },
  56. "kitap" : {
  57. "href" : "http://localhost:8080/api/v1/kitaps/5"
  58. },
  59. "category" : {
  60. "href" : "http://localhost:8080/api/v1/kitaps/5/category"
  61. }
  62. }
  63. }, {
  64. "_links" : {
  65. "self" : {
  66. "href" : "http://localhost:8080/api/v1/kitaps/6"
  67. },
  68. "kitap" : {
  69. "href" : "http://localhost:8080/api/v1/kitaps/6"
  70. },
  71. "category" : {
  72. "href" : "http://localhost:8080/api/v1/kitaps/6/category"
  73. }
  74. }
  75. }, {
  76. "_links" : {
  77. "self" : {
  78. "href" : "http://localhost:8080/api/v1/kitaps/7"
  79. },
  80. "kitap" : {
  81. "href" : "http://localhost:8080/api/v1/kitaps/7"
  82. },
  83. "category" : {
  84. "href" : "http://localhost:8080/api/v1/kitaps/7/category"
  85. }
  86. }
  87. }, {
  88. "_links" : {
  89. "self" : {
  90. "href" : "http://localhost:8080/api/v1/kitaps/8"
  91. },
  92. "kitap" : {
  93. "href" : "http://localhost:8080/api/v1/kitaps/8"
  94. },
  95. "category" : {
  96. "href" : "http://localhost:8080/api/v1/kitaps/8/category"
  97. }
  98. }
  99. }, {
  100. "_links" : {
  101. "self" : {
  102. "href" : "http://localhost:8080/api/v1/kitaps/9"
  103. },
  104. "kitap" : {
  105. "href" : "http://localhost:8080/api/v1/kitaps/9"
  106. },
  107. "category" : {
  108. "href" : "http://localhost:8080/api/v1/kitaps/9/category"
  109. }
  110. }
  111. }, {
  112. "_links" : {
  113. "self" : {
  114. "href" : "http://localhost:8080/api/v1/kitaps/10"
  115. },
  116. "kitap" : {
  117. "href" : "http://localhost:8080/api/v1/kitaps/10"
  118. },
  119. "category" : {
  120. "href" : "http://localhost:8080/api/v1/kitaps/10/category"
  121. }
  122. }
  123. } ]
  124. },
  125. "_links" : {
  126. "self" : {
  127. "href" : "http://localhost:8080/api/v1/kitaps"
  128. },
  129. "profile" : {
  130. "href" : "http://localhost:8080/api/v1/profile/kitaps"
  131. }
  132. },
  133. "page" : {
  134. "size" : 20,
  135. "totalElements" : 10,
  136. "totalPages" : 1,
  137. "number" : 0
  138. }
  139. }
java Output:

  1. . ____ _ __ _ _
  2. /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
  3. ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
  4. \\/ ___)| |_)| | | | | || (_| | ) ) ) )
  5. ' |____| .__|_| |_|_| |_\__, | / / / /
  6. =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::        (v2.3.4.RELEASE)

2020-09-27 18:10:53.324  INFO 7528 --- [  restartedMain] com.snmz.KitapEvi.KitapEviApplication    : Starting KitapEviApplication on HP-NEW with PID 7528 (C:\Users\userr\Desktop\SnmzSpring\KitapEvi\target\classes started by userr in C:\Users\userr\Desktop\SnmzSpring\KitapEvi)
2020-09-27 18:10:53.330  INFO 7528 --- [  restartedMain] com.snmz.KitapEvi.KitapEviApplication    : No active profile set, falling back to default profiles: default
2020-09-27 18:10:53.390  INFO 7528 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2020-09-27 18:10:53.390  INFO 7528 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2020-09-27 18:10:54.276  INFO 7528 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFERRED mode.
2020-09-27 18:10:54.351  INFO 7528 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 66ms. Found 2 JPA repository interfaces.
2020-09-27 18:10:55.201  INFO 7528 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2020-09-27 18:10:55.213  INFO 7528 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2020-09-27 18:10:55.213  INFO 7528 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.38]
2020-09-27 18:10:55.350  INFO 7528 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2020-09-27 18:10:55.350  INFO 7528 --- [  restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1959 ms
2020-09-27 18:10:55.660  INFO 7528 --- [  restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2020-09-27 18:10:55.671  INFO 7528 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2020-09-27 18:10:55.802  INFO 7528 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2020-09-27 18:10:55.867  INFO 7528 --- [         task-1] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2020-09-27 18:10:55.933  INFO 7528 --- [         task-1] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 5.4.21.Final
2020-09-27 18:10:56.089  INFO 7528 --- [         task-1] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2020-09-27 18:10:56.227  INFO 7528 --- [         task-1] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
2020-09-27 18:10:56.869  INFO 7528 --- [         task-1] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2020-09-27 18:10:56.876  INFO 7528 --- [         task-1] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2020-09-27 18:10:57.293  WARN 7528 --- [  restartedMain] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2020-09-27 18:10:57.959  INFO 7528 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2020-09-27 18:10:58.015  INFO 7528 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2020-09-27 18:10:58.018  INFO 7528 --- [  restartedMain] DeferredRepositoryInitializationListener : Triggering deferred initialization of Spring Data repositories…
2020-09-27 18:10:58.078  INFO 7528 --- [  restartedMain] DeferredRepositoryInitializationListener : Spring Data repositories initialized!
2020-09-27 18:10:58.089  INFO 7528 --- [  restartedMain] com.snmz.KitapEvi.KitapEviApplication    : Started KitapEviApplication in 5.226 seconds (JVM running for 6.636)
2020-09-27 18:11:04.652  INFO 7528 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2020-09-27 18:11:04.652  INFO 7528 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2020-09-27 18:11:04.678  INFO 7528 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 26 ms
Hibernate: select kitap0_.id as id1_0_, kitap0_.son_güncelleme as son_günc2_0_, kitap0_.aciklama as aciklama3_0_, kitap0_.adi as adi4_0_, kitap0_.aktif as aktif5_0_, kitap0_.birim_fiyat as birim_fi6_0_, kitap0_.category_id as categor11_0_, kitap0_.image_url as image_ur7_0_, kitap0_.stok_kodu as stok_kod8_0_, kitap0_.stoktaki_birimler as stoktaki9_0_, kitap0_.tarih_oluşturuldu as tarih_o10_0_ from snmz_book kitap0_ limit ?



Soran: 27.09.20 18:40
özcann
9p 2ü
lütfen ilgilenirmisiniz proje yarıda kaldı →  özcann 27.09.20 15:43

Henüz cevap veren yok.

Bir cevap yazın: