Package org.apache.openejb.jee

Examples of org.apache.openejb.jee.EjbRelationshipRole$JAXB


        ejbJarJAXBCreate.stop();

        final Event unmarshalEvent = Event.start("unmarshal");
        final Object value;

        final EjbJar$JAXB jaxbType = new EjbJar$JAXB();
        value = Sxc.unmarshalJavaee(resource, jaxbType);

        unmarshalEvent.stop();

        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here


* @version $Rev$ $Date$
*/
public class EjbJarXml {

    public static EjbJar unmarshal(InputStream inputStream) throws Exception {
        return Sxc.unmarshalJavaee(new EjbJar$JAXB(), inputStream);
    }
View Full Code Here

    public static EjbJar unmarshal(InputStream inputStream) throws Exception {
        return Sxc.unmarshalJavaee(new EjbJar$JAXB(), inputStream);
    }

    public static void marshal(EjbJar ejbJar, OutputStream outputStream) throws Exception {
        Sxc.marshal(new EjbJar$JAXB(), ejbJar, new StreamResult(outputStream));
    }
View Full Code Here

    }

    private void initRelationships(EjbModule jar, Map<String, EnterpriseBeanInfo> infos) throws OpenEJBException {
        for (EjbRelation ejbRelation : jar.getEjbJar().getRelationships().getEjbRelation()) {
            Iterator<EjbRelationshipRole> iterator = ejbRelation.getEjbRelationshipRole().iterator();
            EjbRelationshipRole left = iterator.next();
            EjbRelationshipRole right = iterator.next();

            // left role info
            CmrFieldInfo leftCmrFieldInfo = initRelationshipRole(left, right, infos);
            CmrFieldInfo rightCmrFieldInfo = initRelationshipRole(right, left, infos);
            leftCmrFieldInfo.mappedBy = rightCmrFieldInfo;
View Full Code Here

    }

    private void initRelationships(EjbModule jar, Map<String, EnterpriseBeanInfo> infos) throws OpenEJBException {
        for (EjbRelation ejbRelation : jar.getEjbJar().getRelationships().getEjbRelation()) {
            Iterator<EjbRelationshipRole> iterator = ejbRelation.getEjbRelationshipRole().iterator();
            EjbRelationshipRole left = iterator.next();
            EjbRelationshipRole right = iterator.next();

            // left role info
            CmrFieldInfo leftCmrFieldInfo = initRelationshipRole(left, right, infos);
            CmrFieldInfo rightCmrFieldInfo = initRelationshipRole(right, left, infos);
            leftCmrFieldInfo.mappedBy = rightCmrFieldInfo;
View Full Code Here

    }

    private void initRelationships(EjbModule jar, Map<String, EnterpriseBeanInfo> infos) throws OpenEJBException {
        for (EjbRelation ejbRelation : jar.getEjbJar().getRelationships().getEjbRelation()) {
            Iterator<EjbRelationshipRole> iterator = ejbRelation.getEjbRelationshipRole().iterator();
            EjbRelationshipRole left = iterator.next();
            EjbRelationshipRole right = iterator.next();

            // left role info
            CmrFieldInfo leftCmrFieldInfo = initRelationshipRole(left, right, infos);
            CmrFieldInfo rightCmrFieldInfo = initRelationshipRole(right, left, infos);
            leftCmrFieldInfo.mappedBy = rightCmrFieldInfo;
View Full Code Here

                if (roles.size() != 2) {
                    continue;
                }

                // get left entity
                EjbRelationshipRole leftRole = roles.get(0);
                RelationshipRoleSource leftRoleSource = leftRole.getRelationshipRoleSource();
                String leftEjbName = leftRoleSource == null ? null : leftRoleSource.getEjbName();
                Entity leftEntity = entitiesByName.get(leftEjbName);

                // get right entity
                EjbRelationshipRole rightRole = roles.get(1);
                RelationshipRoleSource rightRoleSource = rightRole.getRelationshipRoleSource();
                String rightEjbName = rightRoleSource == null ? null : rightRoleSource.getEjbName();
                Entity rightEntity = entitiesByName.get(rightEjbName);

                // neither left or right have a mapping which is fine
                if (leftEntity == null && rightEntity == null) {
                    continue;
                }
                // left not found?
                if (leftEntity == null) {
                    throw new OpenEJBException("Role source " + leftEjbName + " defined in relationship role " +
                            relation.getEjbRelationName() + "::" + leftRole.getEjbRelationshipRoleName() + " not found");
                }
                // right not found?
                if (rightEntity == null) {
                    throw new OpenEJBException("Role source " + rightEjbName + " defined in relationship role " +
                            relation.getEjbRelationName() + "::" + rightRole.getEjbRelationshipRoleName() + " not found");
                }

                String leftFieldName = null;
                boolean leftSynthetic = false;
                if (leftRole.getCmrField() != null) {
                    leftFieldName = leftRole.getCmrField().getCmrFieldName();
                } else {
                    leftFieldName = rightEntity.getName() + "_" + rightRole.getCmrField().getCmrFieldName();
                    leftSynthetic = true;
                }
                boolean leftIsOne = leftRole.getMultiplicity() == Multiplicity.ONE;

                String rightFieldName = null;
                boolean rightSynthetic = false;
                if (rightRole.getCmrField() != null) {
                    rightFieldName = rightRole.getCmrField().getCmrFieldName();
                } else {
                    rightFieldName = leftEntity.getName() + "_" + leftRole.getCmrField().getCmrFieldName();
                    rightSynthetic = true;
                }
                boolean rightIsOne = rightRole.getMultiplicity() == Multiplicity.ONE;

                if (leftIsOne && rightIsOne) {
                    //
                    // one-to-one
                    //
View Full Code Here

    }

    private void initRelationships(final EjbModule jar, final Map<String, EnterpriseBeanInfo> infos) throws OpenEJBException {
        for (final EjbRelation ejbRelation : jar.getEjbJar().getRelationships().getEjbRelation()) {
            final Iterator<EjbRelationshipRole> iterator = ejbRelation.getEjbRelationshipRole().iterator();
            final EjbRelationshipRole left = iterator.next();
            final EjbRelationshipRole right = iterator.next();

            // left role info
            final CmrFieldInfo leftCmrFieldInfo = initRelationshipRole(left, right, infos);
            final CmrFieldInfo rightCmrFieldInfo = initRelationshipRole(right, left, infos);
            leftCmrFieldInfo.mappedBy = rightCmrFieldInfo;
View Full Code Here

    }

    private void initRelationships(EjbModule jar, Map<String, EnterpriseBeanInfo> infos) throws OpenEJBException {
        for (EjbRelation ejbRelation : jar.getEjbJar().getRelationships().getEjbRelation()) {
            Iterator<EjbRelationshipRole> iterator = ejbRelation.getEjbRelationshipRole().iterator();
            EjbRelationshipRole left = iterator.next();
            EjbRelationshipRole right = iterator.next();

            // left role info
            CmrFieldInfo leftCmrFieldInfo = initRelationshipRole(left, right, infos);
            CmrFieldInfo rightCmrFieldInfo = initRelationshipRole(right, left, infos);
            leftCmrFieldInfo.mappedBy = rightCmrFieldInfo;
View Full Code Here

    }

    private void initRelationships(EjbModule jar, Map<String, EnterpriseBeanInfo> infos) throws OpenEJBException {
        for (EjbRelation ejbRelation : jar.getEjbJar().getRelationships().getEjbRelation()) {
            Iterator<EjbRelationshipRole> iterator = ejbRelation.getEjbRelationshipRole().iterator();
            EjbRelationshipRole left = iterator.next();
            EjbRelationshipRole right = iterator.next();

            // left role info
            CmrFieldInfo leftCmrFieldInfo = initRelationshipRole(left, right, infos);
            CmrFieldInfo rightCmrFieldInfo = initRelationshipRole(right, left, infos);
            leftCmrFieldInfo.mappedBy = rightCmrFieldInfo;
View Full Code Here

TOP

Related Classes of org.apache.openejb.jee.EjbRelationshipRole$JAXB

Copyright © 2018 www.massapicom. 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.