BAEL-4530: A Guide to @DynamicPropertySource in Spring (#9877)
* A Guide to @DynamicPropertySource in Spring * Moving to a new module * Reverting the Changes in the original module
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package com.baeldung.dynamicproperties;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import static javax.persistence.GenerationType.IDENTITY;
|
||||
|
||||
@Entity
|
||||
@Table(name = "articles")
|
||||
public class Article {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = IDENTITY)
|
||||
private Long id;
|
||||
|
||||
private String title;
|
||||
|
||||
private String content;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.baeldung.dynamicproperties;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface ArticleRepository extends JpaRepository<Article, Long> {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.baeldung.dynamicproperties;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class DynamicPropertiesApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(DynamicPropertiesApplication.class, args);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user