fix incorrect dependency
[sdc.git] / openecomp-be / tools / migration / 1702_to_1707_zusammen / src / main / java / org / openecomp / core / migration / loaders / LKGCassandraLoader.java
1 package org.openecomp.core.migration.loaders;
2
3 import com.datastax.driver.mapping.Result;
4 import com.datastax.driver.mapping.annotations.Accessor;
5 import com.datastax.driver.mapping.annotations.Query;
6 import org.openecomp.core.nosqldb.api.NoSqlDb;
7 import org.openecomp.core.nosqldb.factory.NoSqlDbFactory;
8 import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity;
9
10 import java.util.Collection;
11
12 /**
13  * Created by ayalaben on 4/24/2017
14  */
15 public class LKGCassandraLoader {
16
17     private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
18     private static final LKGCassandraLoader.LKGAccessor accessor =
19             noSqlDb.getMappingManager().createAccessor(LKGCassandraLoader.LKGAccessor.class);
20
21     public Collection<LicenseKeyGroupEntity> list() {
22         return accessor.getAll().all();
23     }
24
25     @Accessor
26     interface LKGAccessor {
27         @Query("SELECT * FROM license_key_group")
28         Result<LicenseKeyGroupEntity> getAll();
29
30     }
31 }