use of com.cloud.offerings.NetworkOfferingDetailsVO in project cloudstack by apache.
the class NetworkOfferingDaoImpl method persist.
@Override
@DB
public NetworkOfferingVO persist(NetworkOfferingVO off, Map<Detail, String> details) {
TransactionLegacy txn = TransactionLegacy.currentTxn();
txn.start();
//1) persist the offering
NetworkOfferingVO vo = super.persist(off);
//2) persist the details
if (details != null && !details.isEmpty()) {
for (NetworkOffering.Detail detail : details.keySet()) {
_detailsDao.persist(new NetworkOfferingDetailsVO(off.getId(), detail, details.get(detail)));
}
}
txn.commit();
return vo;
}
use of com.cloud.offerings.NetworkOfferingDetailsVO in project cloudstack by apache.
the class NetworkOfferingDetailsDaoImpl method getNtwkOffDetails.
@Override
public Map<NetworkOffering.Detail, String> getNtwkOffDetails(long offeringId) {
SearchCriteria<NetworkOfferingDetailsVO> sc = DetailSearch.create();
sc.setParameters("offeringId", offeringId);
List<NetworkOfferingDetailsVO> results = search(sc, null);
Map<NetworkOffering.Detail, String> details = new HashMap<NetworkOffering.Detail, String>(results.size());
for (NetworkOfferingDetailsVO result : results) {
details.put(result.getName(), result.getValue());
}
return details;
}
Aggregations