Java 类ims.emergency.vo.domain.BedAvailabilityVoAssembler 实例源码

项目:AvoinApotti    文件:BedAwaitingBedAvailableImpl.java   
public BedAvailabilityVo save(BedAvailabilityVo bedAvailabilityToSave, TrackingForBedAvailabilityVo trackingToSave) throws StaleObjectException, UniqueKeyViolationException
{
    if (bedAvailabilityToSave == null && trackingToSave == null)
        throw new CodingRuntimeException("Cannot save null BedAvailability or TrackingForBedAvailability ");

    DomainFactory factory = getDomainFactory();

    if (bedAvailabilityToSave != null && trackingToSave == null)
    {
        if (!bedAvailabilityToSave.isValidated())
            throw new DomainRuntimeException("BedAvailabilityVo Not Validated.");

        BedAvailability domainBedAvailability = BedAvailabilityVoAssembler.extractBedAvailability(factory, bedAvailabilityToSave);
        factory.save(domainBedAvailability);

        return BedAvailabilityVoAssembler.create(domainBedAvailability);
    }
    else if (bedAvailabilityToSave == null && trackingToSave != null)
    {
        if (!trackingToSave.isValidated())
            throw new DomainRuntimeException("TrackingForBedAvailability Not Validated.");

        Tracking domainTracking = TrackingForBedAvailabilityVoAssembler.extractTracking(factory, trackingToSave);
        factory.save(domainTracking);

        TrackingForBedAvailabilityVo track = TrackingForBedAvailabilityVoAssembler.create(domainTracking);

        if (track != null)
            return track.getBedAvailability();
    }

    return null;
}
项目:openMAXIMS    文件:BedAwaitingBedAvailableImpl.java   
public BedAvailabilityVo save(BedAvailabilityVo bedAvailabilityToSave, TrackingForBedAvailabilityVo trackingToSave) throws StaleObjectException, UniqueKeyViolationException
{
    if (bedAvailabilityToSave == null && trackingToSave == null)
        throw new CodingRuntimeException("Cannot save null BedAvailability or TrackingForBedAvailability ");

    DomainFactory factory = getDomainFactory();

    if (bedAvailabilityToSave != null && trackingToSave == null)
    {
        if (!bedAvailabilityToSave.isValidated())
            throw new DomainRuntimeException("BedAvailabilityVo Not Validated.");

        BedAvailability domainBedAvailability = BedAvailabilityVoAssembler.extractBedAvailability(factory, bedAvailabilityToSave);
        factory.save(domainBedAvailability);

        return BedAvailabilityVoAssembler.create(domainBedAvailability);
    }
    else if (bedAvailabilityToSave == null && trackingToSave != null)
    {
        if (!trackingToSave.isValidated())
            throw new DomainRuntimeException("TrackingForBedAvailability Not Validated.");

        Tracking domainTracking = TrackingForBedAvailabilityVoAssembler.extractTracking(factory, trackingToSave);
        factory.save(domainTracking);

        TrackingForBedAvailabilityVo track = TrackingForBedAvailabilityVoAssembler.create(domainTracking);

        if (track != null)
            return track.getBedAvailability();
    }

    return null;
}
项目:openMAXIMS    文件:AmentAttendanceBedAvailabilityTimesImpl.java   
public ims.emergency.vo.BedAvailabilityVo get(ims.emergency.vo.BedAvailabilityRefVo bedAvailability)
{
    if(bedAvailability == null || bedAvailability.getID_BedAvailability() == null)
        return null;

    BedAvailability doEdTransfer = (BedAvailability) getDomainFactory().getDomainObject(BedAvailability.class, bedAvailability.getID_BedAvailability());

    return BedAvailabilityVoAssembler.create(doEdTransfer);
}
项目:openMAXIMS    文件:AmentAttendanceBedAvailabilityTimesImpl.java   
public ims.emergency.vo.BedAvailabilityVo save(ims.emergency.vo.BedAvailabilityVo bed) throws ims.domain.exceptions.StaleObjectException
{
    if(bed == null)
        throw new CodingRuntimeException("Cannot save a null BedAvailabilityVo.");

    if(!bed.isValidated())
        throw new CodingRuntimeException("BedAvailabilityVo is not validated.");

    DomainFactory factory = getDomainFactory();

    BedAvailability doBed = BedAvailabilityVoAssembler.extractBedAvailability(factory, bed);

    factory.save(doBed);

    return BedAvailabilityVoAssembler.create(doBed);
}
项目:openMAXIMS    文件:EmergencyAttendanceTimeAmendmentsImpl.java   
public BedAvailabilityVoCollection listBedAvailability(CareContextRefVo careContext)
{
    if(careContext == null || careContext.getID_CareContext() == null)
        return null;

    String query = "select bed from BedAvailability as bed left join bed.attendance as cc where cc.id = :CareContextId order by bed.systemInformation.creationDateTime desc";
    List<?> list = getDomainFactory().find(query, new String[] {"CareContextId"}, new Object[] {careContext.getID_CareContext()});

    return BedAvailabilityVoAssembler.createBedAvailabilityVoCollectionFromBedAvailability(list);
}
项目:openMAXIMS    文件:BedAwaitingBedAvailableImpl.java   
public BedAvailabilityVo save(BedAvailabilityVo bedAvailabilityToSave, TrackingForBedAvailabilityVo trackingToSave) throws StaleObjectException, UniqueKeyViolationException
{
    if (bedAvailabilityToSave == null && trackingToSave == null)
        throw new CodingRuntimeException("Cannot save null BedAvailability or TrackingForBedAvailability ");

    DomainFactory factory = getDomainFactory();

    if (bedAvailabilityToSave != null && trackingToSave == null)
    {
        if (!bedAvailabilityToSave.isValidated())
            throw new DomainRuntimeException("BedAvailabilityVo Not Validated.");

        BedAvailability domainBedAvailability = BedAvailabilityVoAssembler.extractBedAvailability(factory, bedAvailabilityToSave);
        factory.save(domainBedAvailability);

        return BedAvailabilityVoAssembler.create(domainBedAvailability);
    }
    else if (bedAvailabilityToSave == null && trackingToSave != null)
    {
        if (!trackingToSave.isValidated())
            throw new DomainRuntimeException("TrackingForBedAvailability Not Validated.");

        Tracking domainTracking = TrackingForBedAvailabilityVoAssembler.extractTracking(factory, trackingToSave);
        factory.save(domainTracking);

        TrackingForBedAvailabilityVo track = TrackingForBedAvailabilityVoAssembler.create(domainTracking);

        if (track != null)
            return track.getBedAvailability();
    }

    return null;
}
项目:openmaxims-linux    文件:BedAwaitingBedAvailableImpl.java   
public BedAvailabilityVo save(BedAvailabilityVo bedAvailabilityToSave, TrackingForBedAvailabilityVo trackingToSave) throws StaleObjectException, UniqueKeyViolationException
{
    if (bedAvailabilityToSave == null && trackingToSave == null)
        throw new CodingRuntimeException("Cannot save null BedAvailability or TrackingForBedAvailability ");

    DomainFactory factory = getDomainFactory();

    if (bedAvailabilityToSave != null && trackingToSave == null)
    {
        if (!bedAvailabilityToSave.isValidated())
            throw new DomainRuntimeException("BedAvailabilityVo Not Validated.");

        BedAvailability domainBedAvailability = BedAvailabilityVoAssembler.extractBedAvailability(factory, bedAvailabilityToSave);
        factory.save(domainBedAvailability);

        return BedAvailabilityVoAssembler.create(domainBedAvailability);
    }
    else if (bedAvailabilityToSave == null && trackingToSave != null)
    {
        if (!trackingToSave.isValidated())
            throw new DomainRuntimeException("TrackingForBedAvailability Not Validated.");

        Tracking domainTracking = TrackingForBedAvailabilityVoAssembler.extractTracking(factory, trackingToSave);
        factory.save(domainTracking);

        TrackingForBedAvailabilityVo track = TrackingForBedAvailabilityVoAssembler.create(domainTracking);

        if (track != null)
            return track.getBedAvailability();
    }

    return null;
}