You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
917 B
29 lines
917 B
package org.ros.chatto.config;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
|
import org.springframework.context.annotation.PropertySource;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import lombok.Getter;
|
|
|
|
@Component
|
|
@EnableConfigurationProperties
|
|
@PropertySource(value = "classpath:queries.properties")
|
|
@Getter
|
|
public class DBInitializerConfig {
|
|
|
|
private final String dbName;
|
|
|
|
private final String numTablesQuery;
|
|
|
|
private final String resetSessionsQuery;
|
|
|
|
public DBInitializerConfig(@Value("${chatto.datasource.database-name}") String dbName,
|
|
@Value("${num-tables}") String numTablesQuery, @Value("${reset-sessions}") String resetSessionsQuery) {
|
|
this.dbName = dbName;
|
|
this.numTablesQuery = numTablesQuery;
|
|
this.resetSessionsQuery = resetSessionsQuery;
|
|
}
|
|
|
|
}
|