diff options
Diffstat (limited to 'adapters/mso-requests-db-adapter')
3 files changed, 26 insertions, 51 deletions
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/RequestDbRepositoryConfiguration.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/RequestDbRepositoryConfiguration.java new file mode 100644 index 0000000000..c32525a62b --- /dev/null +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/RequestDbRepositoryConfiguration.java @@ -0,0 +1,23 @@ +package org.onap.so.adapters.requestsdb; + +import java.util.stream.Collectors; +import javax.persistence.EntityManager; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.rest.core.config.RepositoryRestConfiguration; +import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter; + +@Configuration +public class RequestDbRepositoryConfiguration extends RepositoryRestConfigurerAdapter { + + @Autowired + private EntityManager entityManager; + + @Override + public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) { + config.exposeIdsFor(entityManager.getMetamodel().getEntities().stream().map(e -> e.getJavaType()) + .collect(Collectors.toList()).toArray(new Class[0])); + } + + +} diff --git a/adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml b/adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml deleted file mode 100644 index 5d3a837180..0000000000 --- a/adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml +++ /dev/null @@ -1,51 +0,0 @@ -# will be used as entry in DB to say SITE OFF/ON for healthcheck
-
-server:
- port: 8090
- tomcat:
- max-threads: 50
-ssl-enable: false
-mso:
- adapters:
- requestDb:
- auth: Basic YnBlbDptc28tZGItMTUwNyE=
- endpoint: http://localhost:8081
- logPath: logs
- site-name: localSite
- infra-requests:
- archived:
- period: 180
-spring:
- datasource:
- url: jdbc:mariadb://localhost:3306/requestdb
- username: catalog
- password: catalog123
- driver-class-name: org.mariadb.jdbc.Driver
- initialize: true
- initialization-mode: never
- jpa:
- generate-ddl: false
- show-sql: false
- hibernate:
- ddl-auto: validate
- naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
- enable-lazy-load-no-trans: true
- database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
- security:
- usercredentials:
- -
- username: bpel
- password: '$2a$12$1xyutEZNfjGewIZRfKaE8eZE99f5sYFUmmM80BobI65KNjmcK0JuO'
- role: BPEL-Client
- -
- username: mso_admin
- password: '$2a$12$tidKuu.h88E2nuL95pTVY.ZOYMN/1dp29A9b1o.0GFDsVVSYlMkHa'
- role: ACTUATOR
-
-
-flyway:
- baseline-on-migrate: false
- url: jdbc:mariadb://localhost:3306/requestdb
- user: catalog
- password: catalog123
-
\ No newline at end of file diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.3__Expand_Column_Size_Archived_Infra_Active_Requests_Request_Status.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.3__Expand_Column_Size_Archived_Infra_Active_Requests_Request_Status.sql new file mode 100644 index 0000000000..0780a611db --- /dev/null +++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V6.3__Expand_Column_Size_Archived_Infra_Active_Requests_Request_Status.sql @@ -0,0 +1,3 @@ +use requestdb; + +ALTER TABLE archived_infra_requests MODIFY COLUMN REQUEST_STATUS varchar(25) NULL;
\ No newline at end of file |