Package org.apache.geronimo.xbeans.javaee

Examples of org.apache.geronimo.xbeans.javaee.PersistenceContextRefType


                return;
            }
        }

        // Doesn't exist in deployment descriptor -- add new
        PersistenceContextRefType persistenceContextRef = annotatedApp.addNewPersistenceContextRef();

        //------------------------------------------------------------------------------
        // <persistence-context-ref> required elements:
        //------------------------------------------------------------------------------

        // persistence-context-ref-name
        JndiNameType unitRefName = persistenceContextRef.addNewPersistenceContextRefName();
        unitRefName.setStringValue(persistenceContextRefName);

        //------------------------------------------------------------------------------
        // <persistence-context-ref> optional elements:
        //------------------------------------------------------------------------------

        // persistence-unit-name
        String unitNameAnnotation = annotation.unitName();
        if (!unitNameAnnotation.equals("")) {
            org.apache.geronimo.xbeans.javaee.String persistenceUnitName = persistenceContextRef.addNewPersistenceUnitName();
            persistenceUnitName.setStringValue(unitNameAnnotation);
        }

        // persistence-context-type
        if (annotation.type() == PersistenceContextType.TRANSACTION) {
            PersistenceContextTypeType persistenceContextType = persistenceContextRef.addNewPersistenceContextType();
            persistenceContextType.setStringValue("Transaction");
            persistenceContextRef.setPersistenceContextType(persistenceContextType);
        } else if (annotation.type() == PersistenceContextType.EXTENDED) {
            PersistenceContextTypeType persistenceContextType = persistenceContextRef.addNewPersistenceContextType();
            persistenceContextType.setStringValue("Extended");
            persistenceContextRef.setPersistenceContextType(persistenceContextType);
        }

        // persistence-context-properties
        PersistenceProperty[] properties = annotation.properties();
        for (PersistenceProperty property : properties) {
            PropertyType propertyType = persistenceContextRef.addNewPersistenceProperty();
            XsdStringType propertyName = propertyType.addNewName();
            propertyName.setStringValue(property.name());
            XsdStringType propertyValue = propertyType.addNewValue();
            propertyValue.setStringValue(property.value());
        }

        // injection targets
        if (method != null || field != null) {
            configureInjectionTarget(persistenceContextRef.addNewInjectionTarget(), method, field);
        }

    }
View Full Code Here


                return;
            }
        }

        // Doesn't exist in deployment descriptor -- add new
        PersistenceContextRefType persistenceContextRef = annotatedApp.addNewPersistenceContextRef();

        //------------------------------------------------------------------------------
        // <persistence-context-ref> required elements:
        //------------------------------------------------------------------------------

        // persistence-context-ref-name
        JndiNameType unitRefName = persistenceContextRef.addNewPersistenceContextRefName();
        unitRefName.setStringValue(persistenceContextRefName);

        //------------------------------------------------------------------------------
        // <persistence-context-ref> optional elements:
        //------------------------------------------------------------------------------

        // persistence-unit-name
        String unitNameAnnotation = annotation.unitName();
        if (!unitNameAnnotation.equals("")) {
            org.apache.geronimo.xbeans.javaee.String persistenceUnitName = persistenceContextRef.addNewPersistenceUnitName();
            persistenceUnitName.setStringValue(unitNameAnnotation);
        }

        // persistence-context-type
        if (annotation.type() == PersistenceContextType.TRANSACTION) {
            PersistenceContextTypeType persistenceContextType = persistenceContextRef.addNewPersistenceContextType();
            persistenceContextType.setStringValue("Transaction");
            persistenceContextRef.setPersistenceContextType(persistenceContextType);
        } else if (annotation.type() == PersistenceContextType.EXTENDED) {
            PersistenceContextTypeType persistenceContextType = persistenceContextRef.addNewPersistenceContextType();
            persistenceContextType.setStringValue("Extended");
            persistenceContextRef.setPersistenceContextType(persistenceContextType);
        }

        // persistence-context-properties
        PersistenceProperty[] properties = annotation.properties();
        for (PersistenceProperty property : properties) {
            PropertyType propertyType = persistenceContextRef.addNewPersistenceProperty();
            XsdStringType propertyName = propertyType.addNewName();
            propertyName.setStringValue(property.name());
            XsdStringType propertyValue = propertyType.addNewValue();
            propertyValue.setStringValue(property.value());
        }

        // injection targets
        if (method != null || field != null) {
            configureInjectionTarget(persistenceContextRef.addNewInjectionTarget(), method, field);
        }

    }
View Full Code Here

                return;
            }
        }

        // Doesn't exist in deployment descriptor -- add new
        PersistenceContextRefType persistenceContextRef = annotatedApp.addNewPersistenceContextRef();

        //------------------------------------------------------------------------------
        // <persistence-context-ref> required elements:
        //------------------------------------------------------------------------------

        // persistence-context-ref-name
        JndiNameType unitRefName = persistenceContextRef.addNewPersistenceContextRefName();
        unitRefName.setStringValue(persistenceContextRefName);

        //------------------------------------------------------------------------------
        // <persistence-context-ref> optional elements:
        //------------------------------------------------------------------------------

        // persistence-unit-name
        String unitNameAnnotation = annotation.unitName();
        if (!unitNameAnnotation.equals("")) {
            org.apache.geronimo.xbeans.javaee.String persistenceUnitName = persistenceContextRef.addNewPersistenceUnitName();
            persistenceUnitName.setStringValue(unitNameAnnotation);
        }

        // persistence-context-type
        if (annotation.type() == PersistenceContextType.TRANSACTION) {
            PersistenceContextTypeType persistenceContextType = persistenceContextRef.addNewPersistenceContextType();
            persistenceContextType.setStringValue("Transaction");
            persistenceContextRef.setPersistenceContextType(persistenceContextType);
        } else if (annotation.type() == PersistenceContextType.EXTENDED) {
            PersistenceContextTypeType persistenceContextType = persistenceContextRef.addNewPersistenceContextType();
            persistenceContextType.setStringValue("Extended");
            persistenceContextRef.setPersistenceContextType(persistenceContextType);
        }

        // persistence-context-properties
        PersistenceProperty[] properties = annotation.properties();
        for (PersistenceProperty property : properties) {
            PropertyType propertyType = persistenceContextRef.addNewPersistenceProperty();
            XsdStringType propertyName = propertyType.addNewName();
            propertyName.setStringValue(property.name());
            XsdStringType propertyValue = propertyType.addNewValue();
            propertyValue.setStringValue(property.value());
        }

        // injection targets
        if (method != null || field != null) {
            configureInjectionTarget(persistenceContextRef.addNewInjectionTarget(), method, field);
        }

    }
View Full Code Here

                return;
            }
        }

        // Doesn't exist in deployment descriptor -- add new
        PersistenceContextRefType persistenceContextRef = annotatedApp.addNewPersistenceContextRef();

        //------------------------------------------------------------------------------
        // <persistence-context-ref> required elements:
        //------------------------------------------------------------------------------

        // persistence-context-ref-name
        JndiNameType unitRefName = persistenceContextRef.addNewPersistenceContextRefName();
        unitRefName.setStringValue(persistenceContextRefName);

        //------------------------------------------------------------------------------
        // <persistence-context-ref> optional elements:
        //------------------------------------------------------------------------------

        // persistence-unit-name
        String unitNameAnnotation = annotation.unitName();
        if (!unitNameAnnotation.equals("")) {
            org.apache.geronimo.xbeans.javaee.String persistenceUnitName = persistenceContextRef.addNewPersistenceUnitName();
            persistenceUnitName.setStringValue(unitNameAnnotation);
        }

        // persistence-context-type
        if (annotation.type() == PersistenceContextType.TRANSACTION) {
            PersistenceContextTypeType persistenceContextType = persistenceContextRef.addNewPersistenceContextType();
            persistenceContextType.setStringValue("Transaction");
            persistenceContextRef.setPersistenceContextType(persistenceContextType);
        } else if (annotation.type() == PersistenceContextType.EXTENDED) {
            PersistenceContextTypeType persistenceContextType = persistenceContextRef.addNewPersistenceContextType();
            persistenceContextType.setStringValue("Extended");
            persistenceContextRef.setPersistenceContextType(persistenceContextType);
        }

        // persistence-context-properties
        PersistenceProperty[] properties = annotation.properties();
        for (PersistenceProperty property : properties) {
            PropertyType propertyType = persistenceContextRef.addNewPersistenceProperty();
            XsdStringType propertyName = propertyType.addNewName();
            propertyName.setStringValue(property.name());
            XsdStringType propertyValue = propertyType.addNewValue();
            propertyValue.setStringValue(property.value());
        }

        // injection targets
        if (method != null || field != null) {
            configureInjectionTarget(persistenceContextRef.addNewInjectionTarget(), method, field);
        }

    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.xbeans.javaee.PersistenceContextRefType

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.