Add flyway database migration tool. Read diva news from database

This commit is contained in:
samnyan
2020-01-17 01:03:14 +09:00
parent a9a9ae4bbc
commit 3d99839fef
15 changed files with 7229 additions and 9 deletions

View File

@@ -0,0 +1,15 @@
package icu.samnyan.aqua.sega.general.dao;
import icu.samnyan.aqua.sega.general.model.PropertyEntry;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;
/**
* @author samnyan (privateamusement@protonmail.com)
*/
@Repository
public interface PropertyEntryRepository extends JpaRepository<PropertyEntry, Long> {
Optional<PropertyEntry> findByPropertyKey(String key);
}

View File

@@ -0,0 +1,33 @@
package icu.samnyan.aqua.sega.general.model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.io.Serializable;
/**
* @author samnyan (privateamusement@protonmail.com)
*/
@Entity(name = "ServerPropertyEntry")
@Table(name = "property")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PropertyEntry implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
@Column(unique = true)
private String propertyKey;
private String propertyValue;
public PropertyEntry(String propertyKey, String propertyValue) {
this.propertyKey = propertyKey;
this.propertyValue = propertyValue;
}
}