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