forked from Cookies_Github_mirror/AquaDX
Add flyway database migration tool. Read diva news from database
This commit is contained in:
@@ -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);
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user