Package org.apache.openejb.jee.jpa

Examples of org.apache.openejb.jee.jpa.MappedSuperclass.addField()


            String fieldName = bean.getPrimkeyField();
            MappedSuperclass superclass = superclassByField.get(fieldName);
            if (superclass == null) {
                throw new IllegalStateException("Primary key field " + fieldName + " is not defined in class " + ejbClassName + " or any super classes");
            }
            superclass.addField(new Id(fieldName));
            mapping.addField(new AttributeOverride(fieldName));
            primaryKeyFields.add(fieldName);
        } else if ("java.lang.Object".equals(bean.getPrimKeyClass())) {
            String fieldName = "OpenEJB_pk";
            Id field = new Id(fieldName);
View Full Code Here


                    if (Modifier.isPublic(modifiers) && !Modifier.isStatic(modifiers) && allFields.contains(fieldName)) {
                        superclass = superclassByField.get(fieldName);
                        if (superclass == null) {
                            throw new IllegalStateException("Primary key field " + fieldName + " is not defined in class " + ejbClassName + " or any super classes");
                        }
                        superclass.addField(new Id(fieldName));
                        mapping.addField(new AttributeOverride(fieldName));
                        primaryKeyFields.add(fieldName);
                    }
                }
                if (superclass != null) {
View Full Code Here

            if (!primaryKeyFields.contains(fieldName)) {
                MappedSuperclass superclass = superclassByField.get(fieldName);
                if (superclass == null) {
                    throw new IllegalStateException("Primary key field " + fieldName + " is not defined in class " + ejbClassName + " or any super classes");
                }
                superclass.addField(new Basic(fieldName));
                mapping.addField(new AttributeOverride(fieldName));
            }
        }

        return new HashSet<MappedSuperclass>(superclassByField.values());
View Full Code Here

                if (persistantFields.contains(fieldName)) {
                    fields.put(fieldName, superclass);
                    persistantFields.remove(fieldName);
                } else if (!ENHANCEED_FIELDS.contains(fieldName)){
                    Transient transientField = new Transient(fieldName);
                    superclass.addField(transientField);
                }
            }
            clazz = clazz.getSuperclass();
        }
View Full Code Here

            String fieldName = bean.getPrimkeyField();
            MappedSuperclass superclass = superclassByField.get(fieldName);
            if (superclass == null) {
                throw new IllegalStateException("Primary key field " + fieldName + " is not defined in class " + ejbClassName + " or any super classes");
            }
            superclass.addField(new Id(fieldName));
            mapping.addField(new AttributeOverride(fieldName));
            primaryKeyFields.add(fieldName);
        } else if ("java.lang.Object".equals(bean.getPrimKeyClass())) {
            String fieldName = "OpenEJB_pk";
            Id field = new Id(fieldName);
View Full Code Here

                    if (Modifier.isPublic(modifiers) && !Modifier.isStatic(modifiers) && allFields.contains(fieldName)) {
                        superclass = superclassByField.get(fieldName);
                        if (superclass == null) {
                            throw new IllegalStateException("Primary key field " + fieldName + " is not defined in class " + ejbClassName + " or any super classes");
                        }
                        superclass.addField(new Id(fieldName));
                        mapping.addField(new AttributeOverride(fieldName));
                        primaryKeyFields.add(fieldName);
                    }
                }
                if (superclass != null) {
View Full Code Here

            if (!primaryKeyFields.contains(fieldName)) {
                MappedSuperclass superclass = superclassByField.get(fieldName);
                if (superclass == null) {
                    throw new IllegalStateException("Primary key field " + fieldName + " is not defined in class " + ejbClassName + " or any super classes");
                }
                superclass.addField(new Basic(fieldName));
                mapping.addField(new AttributeOverride(fieldName));
            }
        }

        return new HashSet<MappedSuperclass>(superclassByField.values());
View Full Code Here

                if (persistantFields.contains(fieldName)) {
                    fields.put(fieldName, superclass);
                    persistantFields.remove(fieldName);
                } else if (!ENHANCEED_FIELDS.contains(fieldName)){
                    Transient transientField = new Transient(fieldName);
                    superclass.addField(transientField);
                }
            }
            clazz = clazz.getSuperclass();
        }
View Full Code Here

            final String fieldName = bean.getPrimkeyField();
            final MappedSuperclass superclass = superclassByField.get(fieldName);
            // this need not be here...for CMP 2.x, these are generally autogenerated fields.
            if (superclass != null) {
                // ok, add this field to the superclass mapping
                superclass.addField(new Id(fieldName));
                // the direct mapping is an over ride
                mapping.addField(new AttributeOverride(fieldName));
            } else {
                // this is a normal generated field, it will be in the main class mapping.
                mapping.addField(new Id(fieldName));
View Full Code Here

                    if (Modifier.isPublic(modifiers) && !Modifier.isStatic(modifiers) && allFields.contains(pkFieldName)) {
                        // see if the bean field is concretely defined in one of the superclasses
                        final MappedSuperclass superclass = superclassByField.get(pkFieldName);
                        if (superclass != null) {
                            // ok, we have an override that needs to be specified at the main class level.
                            superclass.addField(new Id(pkFieldName));
                            mapping.addField(new AttributeOverride(pkFieldName));
                            idclass = resolveIdClass(idclass, superclass, beanClass);
                        } else {
                            // this field will be autogenerated
                            mapping.addField(new Id(pkFieldName));
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.