server.port=8182
spring.jpa.hibernate.ddl-auto=create 。spring.jpa.hibernate.ddl-auto=create Create.properties時,您的數據庫的表可以定期創建。 - https://docs.spring.io/spring-data/jpa/docs/current/reference/html/
- https://www.logicbig.com/ - https://howtodoinjava.com/
- https://o7planning.org/ - https://www.concretepage.com/spring-boot/
- https://memorynotfound.com/ - https://www.dineshonjava.com/
如何運行項目。查看properties端口號。
Links:
http://localhost:3092/ http://localhost:3092/welcome
如何在Spring Boot上使用和查看JSP文件
Links:
http://localhost:8182/ http://localhost:8182/personels
如何在春季啟動上使用和查看錯誤頁面
首先,您必須添加到src/main/resources/public/error/(ErrorPage.html)例如404.html or 403.html如果您想查看錯誤頁面。
如果寫下底部鏈接之一,則看不到錯誤頁面為error.html
http://localhost:8182/ http://localhost:8182/personels
如果您寫下底部鏈接之一,則可以將錯誤頁面視為error.html
http://localhost:8182/deneme http://localhost:8182/asd
http://localhost:8182/asdqwe/121243dqwe?c=asldkwqe http://localhost:8182/deneme.jsp
如何使用requestMethod.post,requestMethod.put,requestMethod.delete和requestMethod.get
您可以在PersonelClinicrestControllerTest.java上與Junït進行試驗(src/test/java/java/com/javaegitimleri/app/web/)
You can try runnuing anymethods with run as -> Junit Test in src/test/java/com/javaegitimleri/app/web/PersonelClinicRestControllerTest.java.
Then you can look at changing data on localhost:8182/rest/personels
如何在表中使用JDBC創建模式,表和添加數據。您可以查看src/main/resources/data.sql&schema.sql。
如何將H2數據庫與JDBC一起使用。
Also You can try runnuing createPersonelTest, deletePersonelTest methods with run as -> Junit Test
in src/test/java/com/javaegitimleri/app/web/PersonelClinicRestControllerTest.java.
如何與H2數據庫一起使用JPA
如何使用 @transactional,@id,@generatedValue, @entity,@table @column
如何使用登錄和註銷過程
如何使用特定的登錄頁面
如何使用我記住安全登錄
首先,您必須在pom.xml中添加Spring-boot-starter-Security依賴性文件。
查看src/main/resources/...中的application.properties文件
#you can change username and password. then you can try login proccessing
spring.security.user.name=celal
spring.security.user.password=123456
第一步打開PDADMIN 4,使用SQL編輯器並進行查詢以在名為“人員”數據庫中創建客戶表,您也可以創建任何稱為Different名稱的數據庫。
CREATE TABLE customer(
id BIGINT PRIMARY KEY NOT NULL,
firstname VARCHAR(20),
lastname VARCHAR(20)
);
第二步
First you need to write localhost:8182/save
Then you can try writing bottom any link
localhost:8182/findall
localhost:8182/findbyid?id=3
localhost:8182/findbylastname?lastname=Terim
如何使用登錄過程
任何人都有cool_editor或cool_admin可以輸入命令 /**和 /執行器 /**供AUTHORIZATION輸入鏈接。任何人只有rol_user無法輸入links narks /rest /rest /** and /cartuator /**
links - > localhost:8182/rest/personels , localhost:8182/rest/personel/3 , localhost:8182/rest/personel?fn=Celallinks - > localhost:8182/actuator/health INSERT INTO USERS VALUES('user1','{noop}12345',TRUE);
INSERT INTO USERS VALUES('user2','{noop}secrett',TRUE);
INSERT INTO USERS VALUES('celal','{noop}secret',TRUE);
您可以在下面寫入數據,而不是src/main/resources/data.sql中的第三個SQL查詢,而不是上面的sql queris
INSERT INTO USERS VALUES('user1','{bcrypt}$2a$10$FMQOTEUiRN1L2MV2gfYas.MEDnLcEffuenRme5WdFgkwcuWA2jyhG',TRUE);
INSERT INTO USERS VALUES('user2','{bcrypt}$2a$10$.qPu/z1bV0Lw5uSpv6YMKeiCUI4rsxfNY/HJJBgw9E7CYUULMW3CS',TRUE);
INSERT INTO USERS VALUES('celal','{bcrypt}$2a$10$m9RM8vLgWvu/8Ig21HURG.IHIeFEie8CsKaGV1FeQ88bi27Xz4wJS',TRUE);
當您更改src/main/resources/data.sql中的第一三行時,用戶名和密碼將再次相同。
有關加密數據,您可以在src/test/com/javaegitimleri/ap/test(例如,加密數據)中查看passwordencodertest.java類。
12345 > {bcrypt}$2a$10$FMQOTEUiRN1L2MV2gfYas.MEDnLcEffuenRme5WdFgkwcuWA2jyhGsecrett > {bcrypt}$2a$10$.qPu/z1bV0Lw5uSpv6YMKeiCUI4rsxfNY/HJJBgw9E7CYUULMW3CSsecret - > {bcrypt}$2a$10$m9RM8vLgWvu/8Ig21HURG.IHIeFEie8CsKaGV1FeQ88bi27Xz4wJS如何將postgresql與JPA一起用於crud作為RESTFUL和JSP文件。 create, read, update, delete
打開PDADMIN 4,使用SQL編輯器並進行查詢以在名為Personels的數據庫中創建客戶表。您也可以創建任何稱為Different名稱的數據庫。
CREATE TABLE customer(
id BIGINT PRIMARY KEY NOT NULL,
firstname VARCHAR(20),
lastname VARCHAR(20)
);
您可以嘗試以下示例鏈接。
localhost:8182/ localhost:8182/customers localhost:8182/customer/1
localhost:8182/rest/customers localhost:8182/rest/customer/1
如何使用@onetoone, @joincolumn,@jsonignore用於春季啟動和多個表中的數據。
第一個:在PGADMIN 4中的任何數據庫上創建底部表。
如果更改數據庫的名稱。您可以更改。
CREATE TABLE customer(
id BIGINT PRIMARY KEY NOT NULL,
name VARCHAR(255),
email VARCHAR(255)
);
CREATE TABLE details(
id BIGINT PRIMARY KEY NOT NULL,
city VARCHAR(255),
country VARCHAR(255),
phone_number VARCHAR(255),
customeid BIGINT,
FOREIGN KEY (customerid) REFERENCES customer (id)
);
第二個:寫Localhost:8182/插入以插入數據庫上的數據。然後寫其他鏈接
localhost:8182/details localhost:8182/customers localhost:8182/customers localhost:8182/customer/{id}
localhost:8182/customerjson/{id}
如何在多個表中使用@manytoone進行彈簧啟動和數據。
如何使用@Query使用特定的SQL查詢
第一個:在PGADMIN 4中的任何數據庫上創建底部表。
如果更改數據庫的名稱。您可以更改。
CREATE TABLE car(
id BIGINT PRIMARY KEY NOT NULL,
name VARCHAR(255),
model INTEGER
);
CREATE TABLE customer(
id BIGINT PRIMARY KEY NOT NULL,
name VARCHAR(255),
email VARCHAR(255)
);
CREATE TABLE book(
id BIGINT PRIMARY KEY NOT NULL,
name VARCHAR(255),
customeid BIGINT,
FOREIGN KEY (customer_id) REFERENCES customer (id)
);
第二個:寫Localhost:8182/插入以插入數據庫上的數據。
localhost:8182/books localhost:8182/book/{id} localhost:8182/customers localhost:8182/customer/{id}
如何使用@embeddable,@embedd在春季靴子上用於彈簧數據
第一個:在PGADMIN 4中的任何數據庫上創建底部表。
如果更改數據庫的名稱。您可以更改。
CREATE TABLE car(
id BIGINT PRIMARY KEY NOT NULL,
name VARCHAR(255),
model INTEGER,
details VARCHAR(255)
);
第二個:第一個編寫本地主機:8182/insert_car以在數據庫上插入數據。
localhost:8182/insert_car
然後寫其他鏈接,例如
for Post method on Postman localhost:8182/car
for Put and Delete method on Postman localhost:8182/car/{id}
也可以在任何瀏覽器上寫下這些鏈接
localhost:8182/car1/{id} localhost:8182/car2/{id}
localhost:8182/car_with_name/{name} localhost:8182/car_with_model/{model}
如何在多個表中使用@Onetomany和@manytoone進行春季啟動和數據。
如何在Spring Boot上與JPA Hibernate一起使用胸腺。
第一個:在PGADMIN 4中的任何數據庫上創建底部表。
如果更改數據庫的名稱。您可以更改。
CREATE TABLE customer(
id BIGINT PRIMARY KEY NOT NULL,
name VARCHAR(255),
email VARCHAR(255),
enabled boolen,
password VARCHAR(255)
);
CREATE TABLE customer_role(
id BIGINT PRIMARY KEY NOT NULL,
role_name VARCHAR(255),
customeid BIGINT,
FOREIGN KEY (customer_id) REFERENCES customer (id)
);
第二個:寫本地主機:8182/REST/INSERT以在數據庫上插入數據。
localhost:8182/customers localhost:8182/rest/customers localhost:8182/rest/cust
如何在Spring Boot和WebsecurityConfigurerAdapter上使用靜態用戶和密碼數據使用Spring Security和@Secred @Query。
spring.jpa.hibernate.ddl-auto=create第15行。 CREATE TABLE customer(
id BIGINT PRIMARY KEY NOT NULL,
name VARCHAR(255),
email VARCHAR(255),
enabled boolen,
password VARCHAR(255)
);
CREATE TABLE customer_role(
id BIGINT PRIMARY KEY NOT NULL,
role_name VARCHAR(255),
customeid BIGINT,
FOREIGN KEY (customer_id) REFERENCES customer (id)
);
如何使用Spring Security和@Secure(“ ...”)。在Spring-boot-15-springsecurity-(Simple)-jpa-postgresql/src/main/java/java/com/example/example webConfigurationClass.java explo/exemo/
運行此項目webConfigurationClass.java時,您可以使用用戶和密碼登錄
USER / PASSWORD / ROLE
-------------------------------------------
- admin / admin / "ADMIN"
- celal / celal / "USER"
- arda / arda / "EDITOR"
訪問角色的鏈接
Permitall links
localhost:8182/userinfo/
for ADMIN, ADMIN can access these links
localhost:8182/rest/customers/
for USER, USER can acces these links
localhost:8182/rest/customers/ localhost:8182/rest/customer-by-email/{email}/
localhost:8182/customer/{email}/ localhost:8182/rest/customerbyname/{name]
for EDITOR, EDITOR can acces these links
localhost:8182/rest/cust/ localhost:8182/rest/customer-by-name/{name}/
如何在多個表中使用@manytomany和@jointable用於彈簧啟動和數據。
spring.jpa.hibernate.ddl-auto=create 。spring.jpa.hibernate.ddl-auto=create Create.properties時,您的數據庫的表可以定期創建。 CREATE TABLE student(
id INTEGER PRIMARY KEY NOT NULL,
name VARCHAR(255),
);
CREATE TABLE subject(
id INTEGER PRIMARY KEY NOT NULL,
name VARCHAR(255)
);
如何使用MySQL在Spring Boot和Security上使用註冊和登錄。
spring.jpa.hibernate.ddl-auto=create 。spring.jpa.hibernate.ddl-auto=create Create.properties時,您的數據庫的表可以定期創建。 - Spring Boot
- Spring Security
- Jpa, Hibernate
- Mysql
- Thymeleaf
- Bootstrap

@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
- Spring Boot
- Jpa, Hibernate
- PostgreSQL