Package org.objectweb.speedo.metadata

Examples of org.objectweb.speedo.metadata.SpeedoElement


        if (parent == null) {
            // sc is the root of the tree
            if (sd != null) {
                checkColumn(sc, sd);
                if (sd.strategy == SpeedoDiscriminator.STRATEGY_CLASS_NAME) {
                    SpeedoElement se = (SpeedoElement) sd.elements.get(0);
                    if (se instanceof SpeedoNoFieldColumn) {
                        ((SpeedoNoFieldColumn) se).type = Type.getDescriptor(String.class);
                    }
                }
            }
View Full Code Here


            Object val = discValues.get(oldsd.elements.get(0));
            discValues.put(sd.elements.get(0), val);
            return;
        }
        for (Iterator it = oldsd.elements.iterator(); it.hasNext();) {
            SpeedoElement oldse = (SpeedoElement) it.next();
            if (oldse instanceof SpeedoNoFieldColumn) {
                SpeedoNoFieldColumn snfc = (SpeedoNoFieldColumn) oldse;
                SpeedoElement inheritedse = null;
                for (Iterator it2 = sd.elements.iterator(); inheritedse == null && it2.hasNext();) {
                    SpeedoElement currentse = (SpeedoElement) it2.next();
                    if (currentse instanceof SpeedoNoFieldColumn) {
                        if (snfc.column.name.equals(
                                ((SpeedoNoFieldColumn) currentse).column.name)) {
                            inheritedse = currentse;
                        }
View Full Code Here

        }
    }
   
    private void checkColumn(SpeedoClass sc, SpeedoDiscriminator sd) throws SpeedoException {
        for (int i = 0; i < sd.elements.size(); i++) {
            SpeedoElement se = (SpeedoElement) sd.elements.get(i);
            if (se instanceof SpeedoNoFieldColumn) {
                SpeedoColumn col = ((SpeedoNoFieldColumn) se).column;
                SpeedoField sf = sc.getFieldFromColumn(col.name);
                if (sf != null) {
                    // the specified column correspond to a primitive persistent
View Full Code Here

        SpeedoDiscriminator sd = sc.inheritance.discriminator;
        String filter = null;
        if (sd.expression != null) {
        filter = sd.expression;
        } else if (sd.elements.size() == 1) {
                SpeedoElement se = (SpeedoElement) sd.elements.get(0);
                if (se instanceof SpeedoField) {
                    filter = ((SpeedoField) se).name;
                } else if (se instanceof SpeedoNoFieldColumn) {
                    filter = HIDDEN_FIELD_CLASS_NAME;
                } else {
                    throw new SpeedoException("Unmanaged filter element: " + se);
                }
        } else {
            throw new SpeedoException(
                    "Composite inheritance discriminator not yet supported in Speedo");
        }
        if (filter != null) {
            sc.jormclass.setInheritanceFilter(nd, filter);
            logger.log(BasicLevel.DEBUG, "Assign filter: " + filter);
        }
            if (sc.inheritance.discriminator.elements != null
                    && sc.inheritance.discriminator.elements.size() == 1) {
                SpeedoElement se = (SpeedoElement) sc.inheritance.discriminator.elements.get(0);
                if (se instanceof SpeedoNoFieldColumn) {
                    if (sc.getSuper() == null) {
                        // The discriminator is a column not mapped to a
                        // persistent field. then we have to create a constant
                        // hidden field.
View Full Code Here

TOP

Related Classes of org.objectweb.speedo.metadata.SpeedoElement

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.