aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openecomp/dcae/inventory/daos/DCAEServicesDAO.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/openecomp/dcae/inventory/daos/DCAEServicesDAO.java')
-rw-r--r--src/main/java/org/openecomp/dcae/inventory/daos/DCAEServicesDAO.java41
1 files changed, 20 insertions, 21 deletions
diff --git a/src/main/java/org/openecomp/dcae/inventory/daos/DCAEServicesDAO.java b/src/main/java/org/openecomp/dcae/inventory/daos/DCAEServicesDAO.java
index e40b8b5..9200677 100644
--- a/src/main/java/org/openecomp/dcae/inventory/daos/DCAEServicesDAO.java
+++ b/src/main/java/org/openecomp/dcae/inventory/daos/DCAEServicesDAO.java
@@ -1,28 +1,25 @@
-package org.openecomp.dcae.inventory.daos;
-
-/*
- * ============LICENSE_START==========================================
- * ===================================================================
- * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
+/*-
+ * ============LICENSE_START=======================================================
+ * dcae-inventory
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END============================================
- *
- * ECOMP and OpenECOMP are trademarks
- * and service marks of AT&T Intellectual Property.
- *
+ * ============LICENSE_END=========================================================
*/
+package org.openecomp.dcae.inventory.daos;
+
import org.openecomp.dcae.inventory.dbthings.mappers.DCAEServiceObjectMapper;
import org.openecomp.dcae.inventory.dbthings.models.DCAEServiceObject;
import org.joda.time.DateTime;
@@ -42,17 +39,17 @@ public interface DCAEServicesDAO extends InventoryDAO {
@SqlQuery("select exists (select * from information_schema.tables where table_name = \'dcae_services\')")
Boolean checkIfTableExists();
- @SqlUpdate("create table dcae_services (service_id varchar not null primary key, type_name varchar not null, " +
+ @SqlUpdate("create table dcae_services (service_id varchar not null primary key, type_id varchar not null, " +
"vnf_id varchar not null, vnf_type varchar not null, vnf_location varchar not null, deployment_ref varchar, " +
"created timestamp not null, modified timestamp not null, status varchar not null)")
void createTable();
- @SqlUpdate("insert into dcae_services(service_id, type_name, vnf_id, vnf_type, vnf_location, deployment_ref, " +
- "created, modified, status) values (:serviceId, :typeName, :vnfId, :vnfType, :vnfLocation, :deploymentRef, " +
+ @SqlUpdate("insert into dcae_services(service_id, type_id, vnf_id, vnf_type, vnf_location, deployment_ref, " +
+ "created, modified, status) values (:serviceId, :typeId, :vnfId, :vnfType, :vnfLocation, :deploymentRef, " +
":created, :modified, :status)")
void insert(@BindBean DCAEServiceObject serviceObject);
- @SqlUpdate("update dcae_services set type_name = :typeName, vnf_id = :vnfId, vnf_type = :vnfType, " +
+ @SqlUpdate("update dcae_services set type_id = :typeId, vnf_id = :vnfId, vnf_type = :vnfType, " +
"vnf_location = :vnfLocation, deployment_ref = :deploymentRef, modified = :modified, status = :status " +
"where service_id = :serviceId")
void update(@BindBean DCAEServiceObject serviceObject);
@@ -71,7 +68,9 @@ public interface DCAEServicesDAO extends InventoryDAO {
@Bind("serviceId") String serviceId);
@Mapper(IntegerMapper.class)
- @SqlQuery("select count(1) from dcae_services where status = :status and type_name = :typeName")
- Integer countByType(@Bind("status") DCAEServiceObject.DCAEServiceStatus status, @Bind("typeName") String typeName);
+ @SqlQuery("select count(1) from dcae_services where status = :status and type_id = :typeId")
+ Integer countByType(@Bind("status") DCAEServiceObject.DCAEServiceStatus status, @Bind("typeId") String typeId);
}
+
+