Project lombok:
Intellij: https://projectlombok.org/setup/intellij
Eclipse, Spring Tools Suite: https://projectlombok.org/setup/eclipse
#email
spring.mail.username=your_email_address
spring.mail.password=your_email_password
#mysql
spring.datasource.url=jdbc:mysql://localhost:3306/itechnews?useUnicode=yes&characterEncoding=UTF-8\
&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=
change port: server.port=8082 => server.port=another_port
if after port changing, still given errors: open task manager and kill JavaTM program
#migrate and seeding the database
create database "itechnews"
run once to create and seeding the database then ignore seeding data and ignore create database for later running:
itechnews.seeder.enalble=false
spring.jpa.generate-ddl=false
spring.jpa.hibernate.ddl-auto=none
#ignore show native sql
spring.jpa.show-sql=false
- Find 1 item: findOneBy...
- Find > 1 items: findBy...
- data.content
- data.pageable.offset
- data.pageable.pageSize
- data.pageable.pageNumber
- data.last
- data.totalElements
- data.totalPages
- data.size
- data.numberOfElements
- data.first
Thymeleaf compiling on save: https://stackoverflow.com/questions/12744303/intellij-idea-java-classes-not-auto-compiling-on-save/28764957
- Go to File->Settings, then to "Build,Execution,Deployment"->Compiler and enable the "Make project automatically" flag.
- Press Ctrl-Alt-Shift-/ and select "Registry" from the menu that appears. Enable compiler.automake.allow.when.app.running flag.
- Start/restart the app and observe static content reloading.
- Ctrl + F5 to see your changes.
Add module jpa
- project setting -> add module jpa
- view -> tool windows -> persistanse
Show the database
- view -> tool windows -> database -> new datasource -> mysql
- view -> tool windows -> persistanse