parent
5a3d6ef7ea
commit
ab71d13d2b
@ -0,0 +1,43 @@ |
|||||||
|
package com.example.demo; |
||||||
|
|
||||||
|
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.Table; |
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
|
||||||
|
@Entity |
||||||
|
@Table(name="data") |
||||||
|
public class Data { |
||||||
|
@Id |
||||||
|
@GeneratedValue(strategy=GenerationType.IDENTITY) |
||||||
|
Long id; |
||||||
|
|
||||||
|
String name; |
||||||
|
@Column(columnDefinition="date") |
||||||
|
@JsonFormat(pattern="MM-dd-yyyy") |
||||||
|
Date submittedOn; |
||||||
|
public Long getId() { |
||||||
|
return id; |
||||||
|
} |
||||||
|
public void setId(Long id) { |
||||||
|
this.id = id; |
||||||
|
} |
||||||
|
public String getName() { |
||||||
|
return name; |
||||||
|
} |
||||||
|
public void setName(String name) { |
||||||
|
this.name = name; |
||||||
|
} |
||||||
|
public Date getSubmittedOn() { |
||||||
|
return submittedOn; |
||||||
|
} |
||||||
|
public void setSubmittedOn(Date submittedOn) { |
||||||
|
this.submittedOn = submittedOn; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,7 @@ |
|||||||
|
package com.example.demo; |
||||||
|
|
||||||
|
import org.springframework.data.repository.CrudRepository; |
||||||
|
|
||||||
|
public interface DataRepository extends CrudRepository<Data,Long>{ |
||||||
|
|
||||||
|
} |
@ -1 +1,6 @@ |
|||||||
|
spring.datasource.url=jdbc:mysql://localhost/playground?serverTimezone=UTC |
||||||
|
spring.datasource.username=sigonasr2 |
||||||
|
spring.datasource.password= |
||||||
|
spring.datasource.driver-class-name=com.mysql.jdbc.Driver |
||||||
|
spring.jpa.hibernate.ddl-auto=update |
||||||
|
spring.jpa.database-platform=org.hibernate.dialect.MySQL8Dialect |
Loading…
Reference in new issue