Examples of OneToOneAssociation


Examples of org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation

            if (intent == Intent.CHECK_IF_VALID || intent == Intent.MODIFY_PROPERTY_SUPPORTING) {
                throw new UnsupportedOperationException(String.format("Cannot invoke supporting method for '%s'; use only property accessor/mutator", memberName));
            }

            final OneToOneAssociation otoa = (OneToOneAssociation) objectMember;
           
            if (intent == Intent.ACCESSOR) {
                return handleGetterMethodOnProperty(args, targetAdapter, otoa, methodName);
            }
           
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation

    // getInstance
    // /////////////////////////////////////////////////////////////

    @Override
    public Instance getInstance(final ObjectAdapter ownerAdapter) {
        final OneToOneAssociation specification = this;
        return ownerAdapter.getInstance(specification);
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation

            }
            // ignore disabled properties
            if (property.isUsable(context.getSession(), adapter, where).isVetoed()) {
                continue;
            }
            final OneToOneAssociation otoa = (OneToOneAssociation) property;
            final ObjectAdapter value = otoa.get(adapter);
            if (otoa.isAssociationValid(adapter, value).isVetoed()) {
                if (buf.length() > 0) {
                    buf.append(", ");
                }
                buf.append(property.getName());
            }
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation

            if (exclude(spec)) {
                continue;
            }
            final List<ObjectAssociation> properties = spec.getAssociations(Contributed.EXCLUDED, ObjectAssociation.Filters.PROPERTIES);
            for (ObjectAssociation property : properties) {
                final OneToOneAssociation otoa = (OneToOneAssociation) property;
                if (exclude(otoa)) {
                    continue;
                }
                rows.add(new MetaModelRow(spec, otoa));
            }
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation

            }
            // ignore disabled properties
            if (property.isUsable(context.getSession(), adapter, where).isVetoed()) {
                continue;
            }
            final OneToOneAssociation otoa = (OneToOneAssociation) property;
            final ObjectAdapter value = otoa.get(adapter);
            if (otoa.isAssociationValid(adapter, value).isVetoed()) {
                if (buf.length() > 0) {
                    buf.append(", ");
                }
                buf.append(property.getName());
            }
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation

     * @return adapter, which may be different from the original (if a {@link org.apache.isis.core.metamodel.facets.object.viewmodel.ViewModelFacet#isCloneable(Object) cloneable} view model, for example.
     */
    public ObjectAdapter apply() {
        ObjectAdapter adapter = getObjectAdapterMemento().getObjectAdapter(ConcurrencyChecking.CHECK);
        for (final ScalarModel scalarModel : propertyScalarModels.values()) {
            final OneToOneAssociation property = scalarModel.getPropertyMemento().getProperty();

            //
            // previously there was a guard here to only apply changes provided:
            //
            // property.containsDoOpFacet(NotPersistedFacet.class) == null
            //
            // however, that logic is wrong; although a property may not be directly
            // persisted so far as JDO is concerned, it may be indirectly persisted
            // as the result of business logic in the setter.
            //
            // for example, see ExampleTaggableEntity (in isisaddons-module-tags).
            //

            final ObjectAdapter associate = scalarModel.getObject();
            property.set(adapter, associate);
        }

        final ViewModelFacet viewModelFacet = adapter.getSpecification().getFacet(ViewModelFacet.class);
        if(viewModelFacet != null) {
            final Object viewModel = adapter.getObject();
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation

        final JsonRepresentation membersList = JsonRepresentation.newArray();
        representation.mapPut("members", membersList);
        final List<ObjectAssociation> associations = objectSpecification.getAssociations(Contributed.EXCLUDED);
        for (final ObjectAssociation association : associations) {
            if (association.isOneToOneAssociation()) {
                final OneToOneAssociation property = (OneToOneAssociation) association;
                final LinkBuilder linkBuilder = PropertyDescriptionReprRenderer.newLinkToBuilder(getRendererContext(), Rel.PROPERTY, objectSpecification, property);
                membersList.arrayAdd(linkBuilder.build());
            } else if (association.isOneToManyAssociation()) {
                final OneToManyAssociation collection = (OneToManyAssociation) association;
                final LinkBuilder linkBuilder = CollectionDescriptionReprRenderer.newLinkToBuilder(getRendererContext(), Rel.PROPERTY, objectSpecification, collection);
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation

    @Override
    public ObjectAdapter that(final PerformContext performContext) throws ScenarioBoundValueException {

        final ObjectAdapter onAdapter = performContext.getOnAdapter();
        final OneToOneAssociation otoa = (OneToOneAssociation) performContext.getObjectMember();

        final Consent validityConsent = otoa.isAssociationValid(onAdapter, null);

        if (!getAssertion().satisfiedBy(validityConsent)) {
            final CellBinding thatBinding = performContext.getPeer().getThatItBinding();
            throw ScenarioBoundValueException.current(thatBinding, getAssertion().getReason(validityConsent));
        }
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation

    public void doHandle(final PerformContext performContext) throws ScenarioBoundValueException {

        final ObjectAdapter onAdapter = performContext.getOnAdapter();
        final ObjectMember nakedObjectMember = performContext.getObjectMember();

        final OneToOneAssociation otoa = (OneToOneAssociation) nakedObjectMember;

        // set
        final PropertyClearFacet clearFacet = otoa.getFacet(PropertyClearFacet.class);
        final CellBinding thatItBinding = performContext.getPeer().getThatItBinding();
        if (clearFacet == null) {
            throw ScenarioBoundValueException.current(thatItBinding, "(cannot clear)");
        }

        // validate setting to null
        final Consent validConsent = otoa.isAssociationValid(onAdapter, null);
        if (validConsent.isVetoed()) {
            throw ScenarioBoundValueException.current(thatItBinding, validConsent.getReason());
        }

        clearFacet.clearProperty(onAdapter);
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation

            if (readOnly[i] || errors[i] != null) {
                continue;
            }
            final ObjectAssociation fld = fields[i];
            if (fld.isOneToOneAssociation()) {
                final OneToOneAssociation oneToOneAssociation = (OneToOneAssociation) fld;
                final ObjectAdapter entryReference = entries[i];
                final ObjectAdapter currentReference = oneToOneAssociation.get(target);
                if (currentReference != entryReference) {
                    final Consent valueValid = ((OneToOneAssociation) fld).isAssociationValid(target, entryReference);
                    errors[i] = valueValid.getReason();
                }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.