Package org.apache.openejb.jee.jpa

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


                final MappedSuperclass superclass = superclassByField.get(fieldName);
                // if this field is defined by one of the superclasses, then
                // we need to provide a mapping for this.
                if (superclass != null) {
                    // we need to mark this as being in one of the superclasses
                    superclass.addField(new Basic(fieldName));
                    mapping.addField(new AttributeOverride(fieldName));
                } else {
                    // directly generated.
                    mapping.addField(new Basic(fieldName));
                }
View Full Code Here


            final String fieldName = bean.getPrimkeyField();
            final 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())) {
            // a primary field type of Object is an automatically generated
            // pk field.  Mark it as such and add it to the mapping. 
View Full Code Here

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

        // all of the fields should now be identified by type, so return a set of
View Full Code Here

                        fields.put(fieldName, superclass);
                        persistantFields.remove(fieldName);
                    } else if (!ENHANCED_FIELDS.contains(fieldName)) {
                        // these are fields we need to identify as transient for the persistence engine.
                        final 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

                final MappedSuperclass superclass = superclassByField.get(fieldName);
                // if this field is defined by one of the superclasses, then
                // we need to provide a mapping for this.
                if (superclass != null) {
                    // we need to mark this as being in one of the superclasses
                    superclass.addField(new Basic(fieldName));
                    mapping.addField(new AttributeOverride(fieldName));
                } else {
                    // directly generated.
                    mapping.addField(new Basic(fieldName));
                }
View Full Code Here

            final String fieldName = bean.getPrimkeyField();
            final 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())) {
            // a primary field type of Object is an automatically generated
            // pk field.  Mark it as such and add it to the mapping. 
View Full Code Here

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

        // all of the fields should now be identified by type, so return a set of
View Full Code Here

                        fields.put(fieldName, superclass);
                        persistantFields.remove(fieldName);
                    } else if (!ENHANCED_FIELDS.contains(fieldName)) {
                        // these are fields we need to identify as transient for the persistence engine.
                        final Transient transientField = new Transient(fieldName);
                        superclass.addField(transientField);
                    }
                }
            }
            clazz = clazz.getSuperclass();
        }
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.