1 package org.openecomp.core.migration.loaders;
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.LicenseAgreementEntity;
10 import java.util.Collection;
13 * Created by ayalaben on 4/25/2017.
15 public class LicenseAgreementCassandraLoader {
17 private static final NoSqlDb noSqlDb = NoSqlDbFactory.getInstance().createInterface();
18 private static final LicenseAgreementCassandraLoader.LicenseAgreementAccessor accessor =
19 noSqlDb.getMappingManager().createAccessor(LicenseAgreementCassandraLoader.LicenseAgreementAccessor.class);
21 public Collection<LicenseAgreementEntity> list() {
22 return accessor.getAll().all();
26 interface LicenseAgreementAccessor {
27 @Query("SELECT * FROM license_agreement")
28 Result<LicenseAgreementEntity> getAll();