当前位置: 首页>>代码示例>>Java>>正文


Java Of.IDEMPOTENT属性代码示例

本文整理汇总了Java中org.apache.isis.applib.annotation.ActionSemantics.Of.IDEMPOTENT属性的典型用法代码示例。如果您正苦于以下问题:Java Of.IDEMPOTENT属性的具体用法?Java Of.IDEMPOTENT怎么用?Java Of.IDEMPOTENT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.isis.applib.annotation.ActionSemantics.Of的用法示例。


在下文中一共展示了Of.IDEMPOTENT属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: putCharge

@ActionSemantics(Of.IDEMPOTENT)
public void putCharge(
        @Named("atPath") final String atPath,
        @Named("reference") final String reference,
        @Named("name") final String name,
        @Named("description") @Optional final String description,
        @Named("taxReference") final String taxReference,
        @Named("sortOrder") @Optional final String sortOrder,
        @Named("chargeGroupReference") final String chargeGroupReference,
        @Named("chargeGroupName") final String chargeGroupName,
        @Named("externalReference") @Optional final String externalReference) {

    final ChargeGroup chargeGroup = fetchOrCreateChargeGroup(chargeGroupReference, chargeGroupName);

    final ApplicationTenancy applicationTenancy = applicationTenancies.findTenancyByPath(atPath);

    final Tax tax = taxes.findOrCreate(taxReference, taxReference, applicationTenancy);
    final Charge charge = charges.newCharge(applicationTenancy, reference, name, description, tax, chargeGroup);

    charge.setExternalReference(externalReference);
    charge.setSortOrder(sortOrder);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:22,代码来源:Api.java

示例2: putApplicationTenancy

@ActionSemantics(Of.IDEMPOTENT)
public void putApplicationTenancy(
        @Named("path") final String path,
        @Named("name") final String name) {
    ApplicationTenancy applicationTenancy = applicationTenancies.findTenancyByPath(path);
    if (applicationTenancy == null) {
        final ApplicationTenancyLevel parentLevel = ApplicationTenancyLevel.of(path).parent();
        final ApplicationTenancy parentApplicationTenancy =
                parentLevel != null
                        ? applicationTenancies.findTenancyByPath(parentLevel.getPath())
                        : null;
        applicationTenancy = applicationTenancies.newTenancy(name, path, parentApplicationTenancy);
    }
    applicationTenancy.setName(name);

    // TODO: EST-467, to remove
    getContainer().flush();
}
 
开发者ID:estatio,项目名称:estatio,代码行数:18,代码来源:Api.java

示例3: putPerson

@ActionSemantics(Of.IDEMPOTENT)
public void putPerson(
        @Named("atPath") final String atPath,
        @Named("reference") final String reference,
        @Named("initials") @Optional final String initials,
        @Named("firstName") final String firstName,
        @Named("lastName") final String lastName,
        @Named("Gender") @Optional final String gender) {
    final ApplicationTenancy applicationTenancy = applicationTenancies.findTenancyByPath(atPath);
    Person person = (Person) parties.findPartyByReference(reference);
    if (person == null) {
        person = persons.newPerson(
                reference,
                initials,
                firstName,
                lastName,
                gender == null ? PersonGenderType.UNKNOWN : PersonGenderType.valueOf(gender), applicationTenancy);
    }
    person.setApplicationTenancyPath(applicationTenancy.getPath());
    person.setFirstName(firstName);
    person.setLastName(lastName);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:22,代码来源:Api.java

示例4: putOrganisation

@ActionSemantics(Of.IDEMPOTENT)
public void putOrganisation(
        @Named("atPath") final String atPath,
        @Named("reference") final String reference,
        @Named("name") final String name,
        @Named("vatCode") @Optional final String vatCode,
        @Named("fiscalCode") @Optional final String fiscalCode) {

    final ApplicationTenancy applicationTenancy = applicationTenancies.findTenancyByPath(atPath);

    Organisation org = (Organisation) parties.findPartyByReferenceOrNull(reference);
    if (org == null) {
        org = organisations.newOrganisation(reference, name, applicationTenancy);
    }
    org.setApplicationTenancyPath(atPath);
    org.setName(name);
    org.setFiscalCode(fiscalCode);
    org.setVatCode(vatCode);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:19,代码来源:Api.java

示例5: putPropertyPostalAddress

@ActionSemantics(Of.IDEMPOTENT)
public void putPropertyPostalAddress(
        @Named("propertyReference") final String propertyReference,
        @Named("address1") @Optional final String address1,
        @Named("address2") @Optional final String address2,
        @Named("city") final String city,
        @Named("postalCode") @Optional final String postalCode,
        @Named("stateCode") @Optional final String stateCode,
        @Named("countryCode") final String countryCode) {
    final Property property = properties.findPropertyByReferenceElseNull(propertyReference);
    if (property == null) {
        throw new ApplicationException(String.format("Property with reference %s not found.", propertyReference));
    }
    final CommunicationChannel comm = communicationChannelContributions.findCommunicationChannelForType(property, null);
    if (comm == null) {
        communicationChannelContributions.newPostal(property, CommunicationChannelType.POSTAL_ADDRESS, countries.findCountry(countryCode), states.findState(stateCode), address1, address2, null, postalCode, city);
    }
}
 
开发者ID:estatio,项目名称:estatio,代码行数:18,代码来源:Api.java

示例6: putPartyEmailAddress

@ActionSemantics(Of.IDEMPOTENT)
public void putPartyEmailAddress(
        @Named("reference") final String partyReference,
        @Named("emailAddress") final String emailAddress,
        @Named("legal") @Optional final Boolean legal
) {
    final Party party = fetchParty(partyReference);

    CommunicationChannel comm = emailAddresses.findByEmailAddress(party, emailAddress);
    if (comm == null) {
        comm = communicationChannels.newEmail(party, CommunicationChannelType.EMAIL_ADDRESS, emailAddress);
        if (legal != null) {
            comm.setLegal(legal);
        }
    }

}
 
开发者ID:estatio,项目名称:estatio,代码行数:17,代码来源:Api.java

示例7: putLease

@ActionSemantics(Of.IDEMPOTENT)
public void putLease(
        @Named("reference") final String reference,
        @Named("name") final String name,
        @Named("tenantReference") final String tenantReference,
        @Named("landlordReference") final String landlordReference,
        @Named("type") final String type,
        @Named("startDate") @Optional final LocalDate startDate,
        @Named("endDate") @Optional final LocalDate endDate,
        @Named("tenancyStartDate") @Optional final LocalDate tenancyStartDate,
        @Named("tenancyEndDate") @Optional final LocalDate tenancyEndDate,
        @Named("propertyReference") @Optional final String propertyReference
) {
    final Party tenant = fetchParty(tenantReference);
    final Party landlord = fetchParty(landlordReference);
    Lease lease = leases.findLeaseByReferenceElseNull(reference);
    final LeaseType leaseType = leaseTypes.findOrCreate(type, null);
    final Property property = fetchProperty(propertyReference, null, false);

    if (lease == null) {
        lease = leases.newLease(property.getApplicationTenancy(), reference, name, leaseType, startDate, endDate, tenancyStartDate, tenancyEndDate, landlord, tenant);
    }
    lease.setTenancyStartDate(tenancyStartDate);
    lease.setTenancyEndDate(tenancyEndDate);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:25,代码来源:Api.java

示例8: putLeaseTermForTurnoverRent

@ActionSemantics(Of.IDEMPOTENT)
public void putLeaseTermForTurnoverRent(
        // start generic fields
        @Named("leaseReference") final String leaseReference,
        @Named("tenantReference") final String tenantReference,
        @Named("unitReference") @Optional final String unitReference,
        @Named("itemSequence") final BigInteger itemSequence,
        @Named("itemType") final String itemType,
        @Named("itemStartDate") final LocalDate itemStartDate,
        @Named("sequence") final BigInteger sequence,
        @Named("startDate") @Optional final LocalDate startDate,
        @Named("endDate") @Optional final LocalDate endDate,
        @Named("status") @Optional final String status,
        // end generic fields
        @Named("turnoverRentRule") @Optional final String turnoverRentRule,
        @Named("auditedTurnover") @Optional final BigDecimal auditedTurnover,
        @Named("auditedTurnoverRent") @Optional final BigDecimal auditedTurnoverRent) {
    final LeaseTermForTurnoverRent term = (LeaseTermForTurnoverRent) putLeaseTerm(leaseReference, unitReference, itemSequence, itemType, itemStartDate, startDate, endDate, sequence, status);
    if (term != null) {
        term.setTurnoverRentRule(turnoverRentRule);
        term.setAuditedTurnover(auditedTurnover);
        term.setAuditedTurnoverRent(auditedTurnoverRent);
    }
}
 
开发者ID:estatio,项目名称:estatio,代码行数:24,代码来源:Api.java

示例9: putCountry

@ActionSemantics(Of.IDEMPOTENT)
public void putCountry(
        @Named("code") final String code,
        @Named("alpha2Code") final String alpha2Code,
        @Named("name") final String name) {
    Country country = countries.findCountry(code);
    if (country == null) {
        country = countries.createCountry(code, alpha2Code, name);
    }
}
 
开发者ID:estatio,项目名称:estatio,代码行数:10,代码来源:Api.java

示例10: putState

@ActionSemantics(Of.IDEMPOTENT)
public void putState(
        @Named("code") final String reference,
        @Named("name") final String name,
        @Named("countryCode") final String countryCode) {
    final Country country = fetchCountry(countryCode);
    State state = states.findState(countryCode);
    if (state == null) {
        state = states.newState(reference, name, country);
    }
    state.setName(name);
    state.setCountry(country);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:13,代码来源:Api.java

示例11: putLeaseType

@ActionSemantics(Of.IDEMPOTENT)
public void putLeaseType(
        @Named("reference") final String reference,
        @Named("name") final String name) {
    final LeaseType leaseType = leaseTypes.findOrCreate(reference, name);
    if (ObjectUtils.compare(name, leaseType.getName()) != 0) {
        leaseType.setName(name);
    }
}
 
开发者ID:estatio,项目名称:estatio,代码行数:9,代码来源:Api.java

示例12: putBankMandate

@ActionSemantics(Of.IDEMPOTENT)
public void putBankMandate(
        @Named("reference") final String reference,
        @Named("sepaMandateIdentifier") @Optional final String sepaMandateIdentifier,
        @Named("name") @Optional final String name,
        @Named("leaseReference") final String leaseReference,
        @Named("debtorReference") final String debtorReference,
        @Named("creditorReference") final String creditorReference,
        @Named("bankAccountReference") final String bankAccountReference,
        @Named("startDate") final LocalDate startDate,
        @Named("endDate") @Optional final LocalDate endDate) {
    BankMandate bankMandate = (BankMandate) agreements.findAgreementByReference(reference);
    final BankAccount bankAccount = (BankAccount) financialAccounts.findAccountByReference(bankAccountReference);
    if (bankAccount == null)
        throw new ApplicationException(String.format("BankAccount with reference %1$s not found", bankAccountReference));
    final Lease lease = fetchLease(leaseReference);
    final Party debtor = fetchParty(debtorReference);
    final Party creditor = fetchParty(creditorReference);

    if (bankMandate == null) {

        lease.newMandate(bankAccount, reference, startDate, endDate);
        bankMandate = lease.getPaidBy();

        bankMandate.setName(name);

        // EST-467, previously was:
        // bankMandate = bankMandates.newBankMandate(reference, name,
        // startDate, endDate, debtor, creditor, bankAccount);
    }

    // upsert
    bankMandate.setBankAccount(bankAccount);
    bankMandate.setName(name);
    bankMandate.setStartDate(startDate);
    bankMandate.setEndDate(endDate);
    bankMandate.setSepaMandateIdentifier(sepaMandateIdentifier);
    lease.paidBy(bankMandate);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:39,代码来源:Api.java

示例13: putUnit

@ActionSemantics(Of.IDEMPOTENT)
public void putUnit(
        @Named("reference") final String reference,
        @Named("propertyReference") final String propertyReference,
        @Named("ownerReference") @Optional final String ownerReference,
        @Named("name") final String name, @Named("type") final String type,
        @Named("startDate") @Optional final LocalDate startDate,
        @Named("endDate") @Optional final LocalDate endDate,
        @Named("area") @Optional final BigDecimal area,
        @Named("salesArea") @Optional final BigDecimal salesArea,
        @Named("storageArea") @Optional final BigDecimal storageArea,
        @Named("mezzanineArea") @Optional final BigDecimal mezzanineArea,
        @Named("dehorsArea") @Optional final BigDecimal dehorsArea,
        @Named("address1") @Optional final String address1,
        @Named("city") @Optional final String city,
        @Named("postalCode") @Optional final String postalCode,
        @Named("stateCode") @Optional final String stateCode,
        @Named("countryCode") @Optional final String countryCode) {
    final Property property = fetchProperty(propertyReference, null, false);
    Unit unit = units.findUnitByReference(reference);
    if (unit == null) {
        unit = property.newUnit(reference, name, UnitType.BOUTIQUE);
    }
    // set attributes
    unit.setName(name);
    unit.setType(UnitType.valueOf(type));
    unit.changeDates(startDate, endDate);
    unit.setArea(area);
    unit.setSalesArea(salesArea);
    unit.setStorageArea(storageArea);
    unit.setMezzanineArea(mezzanineArea);
    unit.setDehorsArea(dehorsArea);
    final CommunicationChannel cc = communicationChannelContributions.findCommunicationChannelForType(unit, CommunicationChannelType.POSTAL_ADDRESS);
    if (cc == null) {
        communicationChannelContributions.newPostal(unit, CommunicationChannelType.POSTAL_ADDRESS, countries.findCountry(countryCode), states.findState(stateCode), address1, null, null, postalCode, city);
    }
}
 
开发者ID:estatio,项目名称:estatio,代码行数:37,代码来源:Api.java

示例14: putPropertyActor

@ActionSemantics(Of.IDEMPOTENT)
public void putPropertyActor(
        @Named("propertyReference") final String propertyReference,
        @Named("reference") final String partyReference,
        @Named("type") final String typeStr,
        @Named("startDate") @Optional final LocalDate startDate,
        @Named("endDate") @Optional final LocalDate endDate) {
    final Property property = fetchProperty(propertyReference, null, false);
    final Party party = fetchParty(partyReference);
    final FixedAssetRoleType type = FixedAssetRoleType.valueOf(typeStr);
    property.addRoleIfDoesNotExist(party, type, startDate, endDate);
}
 
开发者ID:estatio,项目名称:estatio,代码行数:12,代码来源:Api.java

示例15: putLeasePostalAddress

@ActionSemantics(Of.IDEMPOTENT)
public void putLeasePostalAddress(
        @Named("reference") final String partyReference,
        @Named("agreementRoleType") final String agreementRoleType,
        @Named("leaseReference") @Optional final String leaseReference,
        @Named("address1") @Optional final String address1,
        @Named("address2") @Optional final String address2,
        @Named("address3") @Optional final String address3,
        @Named("postalCode") @Optional final String postalCode,
        @Named("city") @Optional final String city,
        @Named("stateCode") @Optional final String stateCode,
        @Named("countryCode") @Optional final String countryCode, @Named("isInvoiceAddress") @Optional final BigInteger isInvoiceAddress
) {
    if (address1 != null && partyReference != null && leaseReference != null) {
        final Lease lease = fetchLease(leaseReference);
        final Party party = fetchParty(partyReference);
        final AgreementRoleCommunicationChannelType agreementRoleCommunicationChannelType = agreementRoleCommunicationChannelTypes.findByTitle(isInvoiceAddress.compareTo(BigInteger.ZERO) == 0 ? LeaseConstants.AgreementRoleCommunicationChannelType.INVOICE_ADDRESS.getTitle() : LeaseConstants.AgreementRoleCommunicationChannelType.ADMINISTRATION_ADDRESS.getTitle());
        if (agreementRoleCommunicationChannelType == null)
            throw new ApplicationException(String.format("AgreementRoleCommunicationChannelType not found."));
        PostalAddress address = (PostalAddress) postalAddresses.findByAddress(party, address1, postalCode, city, fetchCountry(countryCode));
        if (address == null) {
            address = communicationChannels.newPostal(party, CommunicationChannelType.POSTAL_ADDRESS, address1, address2, null, postalCode, city, fetchState(stateCode, false), fetchCountry(countryCode, false));
        }
        final AgreementRoleType art = agreementRoleTypes.findByTitle(StringUtils.capitalize(agreementRoleType.toLowerCase()));
        if (art == null)
            throw new ApplicationException(String.format("AgreementRoleType %s not found.", agreementRoleType));
        final AgreementRole role = lease.findRole(party, art, clockService.now());
        if (role == null)
            throw new ApplicationException(String.format("Role for %s, %s not found.", partyReference, agreementRoleType));
        role.addCommunicationChannel(agreementRoleCommunicationChannelType, address);
    }
}
 
开发者ID:estatio,项目名称:estatio,代码行数:32,代码来源:Api.java


注:本文中的org.apache.isis.applib.annotation.ActionSemantics.Of.IDEMPOTENT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。