Soru Geçmişi
«« Soruya geri dön
27.09.20 23:05
localhost da mysql eklediğim bilgiler gelmiyor
package com.snmz.KitapEvi.Entity; import java.math.BigDecimal; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import lombok.Getter; import lombok.Setter; import lombok.ToString; @Entity @Table(name = "snmz_book") @Setter @Getter @ToString public class Kitap { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(name = "stok_kodu") private String stok_kodu; @Column(name = "adi") private String adi; @Column(name = "aciklama") private String aciklama; @Column(name = "birim_fiyat") private BigDecimal birim_fiyat; @Column(name = "image_url") private String image_url; @Column(name = "aktif") private Boolean aktif; @Column(name = "stoktaki_birimler") private int stoktaki_birimler; @Column(name = "tarih_oluşturuldu") private Date tarih_olusturuldu; @Column(name = "Son_güncelleme") private Date Son_güncelleme; @ManyToOne @JoinColumn(name = "category_id", nullable = false) private SnmzCategory category; } -------------------- package com.snmz.KitapEvi.Repository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import org.springframework.web.bind.annotation.CrossOrigin; import com.snmz.KitapEvi.Entity.Kitap; @CrossOrigin("http://localhost:4200") @Repository public interface KitapRepository extends JpaRepository < Kitap, Long > { } --------------------- spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/kitapsales?useSSL=false&useUnicode=yes&characterEncoding=UTF-8&allowPublicKeyRetrieval=true&serverTimezone=UTC spring.datasource.username=root spring.datasource.password=190325 spring.jpa.show-sql=true spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect spring.data.rest.base-path=/api/v1 ----------------------------http://localhost:8080/api/v1/kitaps------------- bilgiler gelmiyor gelmesi gerekliydi {
"_embedded" : {
"kitaps" : [ {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/1"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/1"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/1/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/2"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/2"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/2/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/3"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/3"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/3/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/4"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/4"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/4/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/5"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/5"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/5/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/6"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/6"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/6/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/7"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/7"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/7/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/8"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/8"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/8/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/9"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/9"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/9/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/10"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/10"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/10/category"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps"
},
"profile" : {
"href" : "http://localhost:8080/api/v1/profile/kitaps"
}
},
"page" : {
"size" : 20,
"totalElements" : 10,
"totalPages" : 1,
"number" : 0
}
} java Output: . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: 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 ?
Ekleyen: özcann
Değiştiren: cevapsitesi
27.09.20 18:45
localhost da mysql eklediğim bilgiler gelmiyor
package com.snmz.KitapEvi.Entity; import java.math.BigDecimal; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import lombok.Getter; import lombok.Setter; import lombok.ToString; @Entity @Table(name="snmz_book") @Setter @Getter @ToString public class Kitap { @Id @GeneratedValue(strategy =GenerationType.IDENTITY) private Long id; @Column(name="stok_kodu") private String stok_kodu; @Column(name="adi") private String adi; @Column(name="aciklama") private String aciklama; @Column(name="birim_fiyat") private BigDecimal birim_fiyat; @Column(name="image_url") private String image_url; @Column(name="aktif") private Boolean aktif; @Column(name="stoktaki_birimler") private int stoktaki_birimler; @Column(name="tarih_oluşturuldu") private Date tarih_olusturuldu; @Column(name="Son_güncelleme") private Date Son_güncelleme; @ManyToOne @JoinColumn(name="category_id",nullable=false) private SnmzCategory category; } -------------------- package com.snmz.KitapEvi.Repository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import org.springframework.web.bind.annotation.CrossOrigin; import com.snmz.KitapEvi.Entity.Kitap; @CrossOrigin("http://localhost:4200") @Repository public interface KitapRepository extends JpaRepository<Kitap, Long>{ } --------------------- spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/kitapsales?useSSL=false&useUnicode=yes&characterEncoding=UTF-8&allowPublicKeyRetrieval=true&serverTimezone=UTC spring.datasource.username=root spring.datasource.password=190325 spring.jpa.show-sql=true spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect spring.data.rest.base-path=/api/v1 ----------------------------http://localhost:8080/api/v1/kitaps------------- bilgiler gelmiyor gelmesi gerekliydi {
"_embedded" : {
"kitaps" : [ {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/1"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/1"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/1/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/2"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/2"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/2/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/3"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/3"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/3/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/4"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/4"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/4/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/5"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/5"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/5/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/6"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/6"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/6/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/7"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/7"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/7/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/8"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/8"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/8/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/9"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/9"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/9/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/10"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/10"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/10/category"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps"
},
"profile" : {
"href" : "http://localhost:8080/api/v1/profile/kitaps"
}
},
"page" : {
"size" : 20,
"totalElements" : 10,
"totalPages" : 1,
"number" : 0
}
} java Output: . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: 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 ?
Ekleyen: özcann
Değiştiren: özcann
27.09.20 18:40
localhost da mysql eklediğim bilgiler gelmiyor
package com.snmz.KitapEvi.Entity; import java.math.BigDecimal; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import lombok.Getter; import lombok.Setter; import lombok.ToString; @Entity @Table(name="snmz_book") @Setter @Getter @ToString public class Kitap { @Id @GeneratedValue(strategy =GenerationType.IDENTITY) private Long id; @Column(name="stok_kodu") private String stok_kodu; @Column(name="adi") private String adi; @Column(name="aciklama") private String aciklama; @Column(name="birim_fiyat") private BigDecimal birim_fiyat; @Column(name="image_url") private String image_url; @Column(name="aktif") private Boolean aktif; @Column(name="stoktaki_birimler") private int stoktaki_birimler; @Column(name="tarih_oluşturuldu") private Date tarih_olusturuldu; @Column(name="Son_güncelleme") private Date Son_güncelleme; @ManyToOne @JoinColumn(name="category_id",nullable=false) private SnmzCategory category; } -------------------- package com.snmz.KitapEvi.Repository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import org.springframework.web.bind.annotation.CrossOrigin; import com.snmz.KitapEvi.Entity.Kitap; @CrossOrigin("http://localhost:4200") @Repository public interface KitapRepository extends JpaRepository<Kitap, Long>{ } --------------------- spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/kitapsales?useSSL=false&useUnicode=yes&characterEncoding=UTF-8&allowPublicKeyRetrieval=true&serverTimezone=UTC spring.datasource.username=root spring.datasource.password=190325 spring.jpa.show-sql=true spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect spring.data.rest.base-path=/api/v1 ----------------------------http://localhost:8080/api/v1/kitaps------------- bilgiler gelmiyor gelmesi gerekliydi {
"_embedded" : {
"kitaps" : [ {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/1"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/1"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/1/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/2"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/2"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/2/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/3"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/3"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/3/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/4"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/4"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/4/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/5"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/5"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/5/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/6"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/6"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/6/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/7"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/7"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/7/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/8"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/8"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/8/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/9"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/9"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/9/category"
}
}
}, {
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps/10"
},
"kitap" : {
"href" : "http://localhost:8080/api/v1/kitaps/10"
},
"category" : {
"href" : "http://localhost:8080/api/v1/kitaps/10/category"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/kitaps"
},
"profile" : {
"href" : "http://localhost:8080/api/v1/profile/kitaps"
}
},
"page" : {
"size" : 20,
"totalElements" : 10,
"totalPages" : 1,
"number" : 0
}
}
Ekleyen: özcann
En fazla 3 eski durum gösterilir.