本文整理了Java中org.zstack.core.db.Q.notNull
方法的一些代码示例,展示了Q.notNull
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Q.notNull
方法的具体详情如下:
包路径:org.zstack.core.db.Q
类名称:Q
方法名:notNull
暂无
代码示例来源:origin: zstackio/zstack
public static boolean isIsoAttachedToVm(String vmUuid) {
boolean exsit = Q.New(VmCdRomVO.class)
.eq(VmCdRomVO_.vmInstanceUuid, vmUuid)
.notNull(VmCdRomVO_.isoUuid)
.isExists();
return exsit;
}
代码示例来源:origin: zstackio/zstack
public static List<String> getIsoUuidByVmUuid(String vmUuid) {
List<String> isoUuids = Q.New(VmCdRomVO.class)
.select(VmCdRomVO_.isoUuid)
.eq(VmCdRomVO_.vmInstanceUuid, vmUuid)
.notNull(VmCdRomVO_.isoUuid)
.listValues();
return isoUuids;
}
代码示例来源:origin: zstackio/zstack
private void handle(APIGetEipAttachableVmNicsMsg msg) {
APIGetEipAttachableVmNicsReply reply = new APIGetEipAttachableVmNicsReply();
boolean isAttached = Q.New(EipVO.class).eq(EipVO_.uuid, msg.getEipUuid()).notNull(EipVO_.vmNicUuid).isExists();
reply.setInventories(isAttached ? new ArrayList<>() : getEipAttachableVmNics(msg));
bus.reply(msg, reply);
}
代码示例来源:origin: zstackio/zstack
.notNull(VmNicVO_.metaData).limit(1).find();
if (nnic == null) {
logger.debug(String.format("add peer l3[uuid:%s] to vip[uuid:%s], the l3 has no vr attached now",
.notNull(VmNicVO_.metaData).limit(1).find();
if (enic == null || enic.getVmInstanceUuid().equals(nnic.getVmInstanceUuid())) {
continue;
代码示例来源:origin: zstackio/zstack
private void checkTotalVMQuota(String currentAccountUuid,
String resourceTargetOwnerAccountUuid,
String vmInstanceUuid,
long totalVmNumQuota,
long totalVmNum) {
if (Q.New(VmInstanceVO.class)
.eq(VmInstanceVO_.uuid, vmInstanceUuid)
.notNull(VmInstanceVO_.lastHostUuid)
.isExists()) {
// Dirty hack - VM with last host UUID means existing VM.
return;
}
QuotaUtil.QuotaCompareInfo quotaCompareInfo;
quotaCompareInfo = new QuotaUtil.QuotaCompareInfo();
quotaCompareInfo.currentAccountUuid = currentAccountUuid;
quotaCompareInfo.resourceTargetOwnerAccountUuid = resourceTargetOwnerAccountUuid;
quotaCompareInfo.quotaName = VmQuotaConstant.VM_TOTAL_NUM;
quotaCompareInfo.quotaValue = totalVmNumQuota;
quotaCompareInfo.currentUsed = totalVmNum;
quotaCompareInfo.request = 1;
new QuotaUtil().CheckQuota(quotaCompareInfo);
}
代码示例来源:origin: zstackio/zstack
@Override
public void prepareDbInitialValue() {
List<IpRangeVO> ipRangeVOS = Q.New(IpRangeVO.class).isNull(IpRangeVO_.prefixLen).list();
for (IpRangeVO ipr : ipRangeVOS) {
ipr.setPrefixLen(NetworkUtils.getPrefixLengthFromNetwork(ipr.getNetmask()));
}
if (!ipRangeVOS.isEmpty()) {
dbf.updateCollection(ipRangeVOS);
}
List<VmNicVO> nics = Q.New(VmNicVO.class).notNull(VmNicVO_.usedIpUuid).list();
List<UsedIpVO> ips = new ArrayList<>();
for (VmNicVO nic : nics) {
UsedIpVO ip = Q.New(UsedIpVO.class).eq(UsedIpVO_.uuid, nic.getUsedIpUuid()).isNull(UsedIpVO_.vmNicUuid).find();
if (ip != null) {
ip.setVmNicUuid(nic.getUuid());
ips.add(ip);
}
}
if (!ips.isEmpty()) {
dbf.updateCollection(ips);
}
}
}
代码示例来源:origin: zstackio/zstack
@AsyncThread
@Deprecated
public void syncVmIsoSystemTag(String vmUuid) {
if (!VmCdRomGlobalProperty.syncVmIsoSystemTag) {
return;
}
VmSystemTags.ISO.delete(vmUuid);
List<VmCdRomVO> cdRomVOS = Q.New(VmCdRomVO.class)
.eq(VmCdRomVO_.vmInstanceUuid, vmUuid)
.notNull(VmCdRomVO_.isoUuid)
.list();
if (cdRomVOS.isEmpty()) {
return;
}
for (VmCdRomVO cdRomVO : cdRomVOS){
SystemTagCreator creator = VmSystemTags.ISO.newSystemTagCreator(vmUuid);
creator.setTagByTokens(map(
e(VmSystemTags.ISO_TOKEN, cdRomVO.getIsoUuid()),
e(VmSystemTags.ISO_DEVICEID_TOKEN, cdRomVO.getDeviceId())
));
creator.create();
}
}
}
代码示例来源:origin: zstackio/zstack
@Override
public void prepareDbInitialValue() {
List<VmNicVO> nics = Q.New(VmNicVO.class).notNull(VmNicVO_.vmInstanceUuid).list();
for (VmNicVO nic : nics) {
if (nic.getUsedIps().size() <= 1) {
continue;
}
/* systemTags for dualStack nic existed */
List<String> secondaryL3Uuids = new DualStackNicSecondaryNetworksOperator().getSecondaryNetworksByVmUuidNic(nic.getVmInstanceUuid(), nic.getL3NetworkUuid());
if (secondaryL3Uuids != null) {
continue;
}
for (UsedIpVO ip : nic.getUsedIps()) {
if (ip.getL3NetworkUuid().equals(nic.getL3NetworkUuid())) {
continue;
}
new DualStackNicSecondaryNetworksOperator().createSecondaryNetworksByVmNic(VmNicInventory.valueOf(nic), ip.getL3NetworkUuid());
}
}
}
}
代码示例来源:origin: zstackio/zstack
.notNull(VmNicVO_.metaData).limit(1).find();
if (rnic == null) {
l3Uuids.addAll(vipPeerL3Uuids);
代码示例来源:origin: zstackio/zstack
.notNull(VmNicVO_.metaData).limit(1).find();
if (rnic != null) {
List<String> vrAttachedL3Uuids = Q.New(VmNicVO.class)
内容来源于网络,如有侵权,请联系作者删除!