Skip to content

thu142857/ITECH-NEWS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

itechnews.com

Thực tập công nhân 2019 - phần web

#Plugins setting

Project lombok:
Intellij: https://projectlombok.org/setup/intellij
Eclipse, Spring Tools Suite: https://projectlombok.org/setup/eclipse

#Application properties

#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=

#Fixing port already use problem

change port: server.port=8082 => server.port=another_port
if after port changing, still given errors: open task manager and kill JavaTM program

#Database

#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

#Jpa Repository

  • Find 1 item: findOneBy...
  • Find > 1 items: findBy...

#Pagination API

  • data.content
  • data.pageable.offset
  • data.pageable.pageSize
  • data.pageable.pageNumber
  • data.last
  • data.totalElements
  • data.totalPages
  • data.size
  • data.numberOfElements
  • data.first

#Tips for using Intellij Idea IDE

Thymeleaf compiling on save: https://stackoverflow.com/questions/12744303/intellij-idea-java-classes-not-auto-compiling-on-save/28764957

  1. Go to File->Settings, then to "Build,Execution,Deployment"->Compiler and enable the "Make project automatically" flag.
  2. Press Ctrl-Alt-Shift-/ and select "Registry" from the menu that appears. Enable compiler.automake.allow.when.app.running flag.
  3. Start/restart the app and observe static content reloading.
  4. Ctrl + F5 to see your changes.

Add module jpa

  1. project setting -> add module jpa
  2. view -> tool windows -> persistanse

Show the database

  1. view -> tool windows -> database -> new datasource -> mysql
  2. view -> tool windows -> persistanse
#Tips for using Eclipse IDE

About

Thực tập công nhân - Phần web

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published