Package javax.persistence

Examples of javax.persistence.PersistenceContext.properties()


        if (pu != null) {
          throw new IllegalStateException("Member may only be annotated with either " +
              "@PersistenceContext or @PersistenceUnit, not both: " + member);
        }
        Properties properties = null;
        PersistenceProperty[] pps = pc.properties();
        if (!ObjectUtils.isEmpty(pps)) {
          properties = new Properties();
          for (int i = 0; i < pps.length; i++) {
            PersistenceProperty pp = pps[i];
            properties.setProperty(pp.name(), pp.value());
View Full Code Here


        if (pu != null) {
          throw new IllegalStateException("Member may only be annotated with either " +
              "@PersistenceContext or @PersistenceUnit, not both: " + member);
        }
        Properties properties = null;
        PersistenceProperty[] pps = pc.properties();
        if (!ObjectUtils.isEmpty(pps)) {
          properties = new Properties();
          for (PersistenceProperty pp : pps) {
            properties.setProperty(pp.name(), pp.value());
          }
View Full Code Here

        if (pu != null) {
          throw new IllegalStateException("Member may only be annotated with either " +
              "@PersistenceContext or @PersistenceUnit, not both: " + member);
        }
        Properties properties = null;
        PersistenceProperty[] pps = pc.properties();
        if (!ObjectUtils.isEmpty(pps)) {
          properties = new Properties();
          for (int i = 0; i < pps.length; i++) {
            PersistenceProperty pp = pps[i];
            properties.setProperty(pp.name(), pp.value());
View Full Code Here

      }
      if (member instanceof Method && ((Method) member).getParameterTypes().length != 1) {
        throw new IllegalStateException("PersistenceContext annotation requires a single-arg method: " + member);
      }
      Properties properties = null;
      PersistenceProperty[] pps = pc.properties();
      if (!ObjectUtils.isEmpty(pps)) {
        properties = new Properties();
        for (int i = 0; i < pps.length; i++) {
          PersistenceProperty pp = pps[i];
          properties.setProperty(pp.name(), pp.value());
View Full Code Here

        if (pu != null) {
          throw new IllegalStateException("Member may only be annotated with either " +
              "@PersistenceContext or @PersistenceUnit, not both: " + member);
        }
        Properties properties = null;
        PersistenceProperty[] pps = pc.properties();
        if (!ObjectUtils.isEmpty(pps)) {
          properties = new Properties();
          for (int i = 0; i < pps.length; i++) {
            PersistenceProperty pp = pps[i];
            properties.setProperty(pp.name(), pp.value());
View Full Code Here

        if (pu != null) {
          throw new IllegalStateException("Member may only be annotated with either " +
              "@PersistenceContext or @PersistenceUnit, not both: " + member);
        }
        Properties properties = null;
        PersistenceProperty[] pps = pc.properties();
        if (!ObjectUtils.isEmpty(pps)) {
          properties = new Properties();
          for (PersistenceProperty pp : pps) {
            properties.setProperty(pp.name(), pp.value());
          }
View Full Code Here

        mField.setAccessible(true);

        PersistenceContext aContext = mField.getAnnotation(PersistenceContext.class);

        Map<String, String> aMap = new HashMap<String, String>();
        for (PersistenceProperty aProp : aContext.properties()) {
            aMap.put(aProp.name(), aProp.value());
        }

        try {
      EntityManagerFactory aFactory = Empire.get().persistenceProvider().createEntityManagerFactory(aContext.name(), aMap);
View Full Code Here

  public ConfigProgram introspectField(AnnotatedField<?> field)
  {
    PersistenceContext pContext = field.getAnnotation(PersistenceContext.class);
   
    PersistenceContextType type = pContext.type();
    PersistenceProperty []properties = pContext.properties();
   
    Field javaField = field.getJavaMember();
   
    if (! javaField.getType().isAssignableFrom(EntityManager.class)) {
      throw new ConfigException(L.l("{0}: @PersistenceContext field must be assignable from EntityManager.",
View Full Code Here

        if (pu != null) {
          throw new IllegalStateException("Member may only be annotated with either " +
              "@PersistenceContext or @PersistenceUnit, not both: " + member);
        }
        Properties properties = null;
        PersistenceProperty[] pps = pc.properties();
        if (!ObjectUtils.isEmpty(pps)) {
          properties = new Properties();
          for (PersistenceProperty pp : pps) {
            properties.setProperty(pp.name(), pp.value());
          }
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.