This commit is contained in:
Francesco 2023-10-17 10:55:05 +02:00
parent 09c63bae4f
commit 0807d5fa45
5 changed files with 27 additions and 2 deletions

View File

@ -61,6 +61,11 @@ public class DbAdminAutoConfiguration {
@Autowired @Autowired
private DbAdminProperties props; private DbAdminProperties props;
/**
* Builds and returns the internal data source.
*
* @return
*/
@Bean @Bean
public DataSource internalDataSource() { public DataSource internalDataSource() {
DataSourceBuilder<?> dataSourceBuilder = DataSourceBuilder.create(); DataSourceBuilder<?> dataSourceBuilder = DataSourceBuilder.create();

View File

@ -50,6 +50,10 @@ public class DbAdminProperties {
*/ */
private boolean testMode = false; private boolean testMode = false;
/**
* Whether Spring Boot Database Admin is enabled
* @return
*/
public boolean isEnabled() { public boolean isEnabled() {
return enabled; return enabled;
} }
@ -58,6 +62,10 @@ public class DbAdminProperties {
this.enabled = enabled; this.enabled = enabled;
} }
/**
* Returns the prefix that is prepended to all routes registered by Spring Boot Database Admin.
* @return
*/
public String getBaseUrl() { public String getBaseUrl() {
return baseUrl; return baseUrl;
} }
@ -66,6 +74,10 @@ public class DbAdminProperties {
this.baseUrl = baseUrl; this.baseUrl = baseUrl;
} }
/**
* Returns the path of the package that contains your JPA `@Entity` classes to be scanned.
* @return
*/
public String getModelsPackage() { public String getModelsPackage() {
return modelsPackage; return modelsPackage;
} }

View File

@ -25,7 +25,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
/** /**
* Disables delete actions on the Entity class. * Disables the export functionality on a specific class.
*/ */
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE) @Target(ElementType.TYPE)

View File

@ -602,6 +602,11 @@ public enum DbFieldType {
return false; return false;
} }
/**
* Returns the corresponding {@linkplain DbFieldType} from a Class object.
* @param klass
* @return
*/
public static DbFieldType fromClass(Class<?> klass) { public static DbFieldType fromClass(Class<?> klass) {
if (klass == Boolean.class || klass == boolean.class) { if (klass == Boolean.class || klass == boolean.class) {
return BOOLEAN; return BOOLEAN;

View File

@ -17,6 +17,9 @@
*/ */
/** /**
* Root package of Spring Boot Database Admin * Root package of Spring Boot Database Admin.
*
* It contains the configuration class which handles the initialization
* and the main {@link tech.ailef.dbadmin.external.DbAdmin} class.
*/ */
package tech.ailef.dbadmin.external; package tech.ailef.dbadmin.external;