Examples of IdClass


Examples of javax.persistence.IdClass

     * In JPA 2, there is a shortcut if the id class is the Pk of the associated class pointed to by the id
     * it ought to be treated as an embedded and not a real IdClass (at least in the Hibernate's internal way
     */
    XClass classWithIdClass = inheritanceState.getClassWithIdClass( false );
    if ( classWithIdClass != null ) {
      IdClass idClass = classWithIdClass.getAnnotation( IdClass.class );
      XClass compositeClass = mappings.getReflectionManager().toXClass( idClass.value() );
      PropertyData inferredData = new PropertyPreloadedData(
          entityBinder.getPropertyAccessType(), "id", compositeClass
      );
      PropertyData baseInferredData = new PropertyPreloadedData(
          entityBinder.getPropertyAccessType(), "id", classWithIdClass
View Full Code Here

Examples of javax.persistence.IdClass

    }
    final boolean subclassAndSingleTableStrategy = inheritanceState.type == InheritanceType.SINGLE_TABLE
        && inheritanceState.hasParents;
    //process idclass if any
    Set<String> idProperties = new HashSet<String>();
    IdClass idClass = null;
    XClass current = null;
    if ( !inheritanceState.hasParents ) {
      //look for idClass
      current = inheritanceState.clazz;
      InheritanceState state = inheritanceState;
      do {
        current = state.clazz;
        if ( current.isAnnotationPresent( IdClass.class ) ) {
          idClass = current.getAnnotation( IdClass.class );
          break;
        }
        state = InheritanceState.getSuperclassInheritanceState(
            current, inheritanceStatePerClass, reflectionManager
        );
      }
      while ( state != null );
    }
    if ( idClass != null ) {
      XClass compositeClass = reflectionManager.toXClass( idClass.value() );
      boolean isComponent = true;
      boolean propertyAnnotated = entityBinder.isPropertyAnnotated( compositeClass );
      String propertyAccessor = entityBinder.getPropertyAccessor( compositeClass );
      String generatorType = "assigned";
      String generator = BinderHelper.ANNOTATION_STRING_DEFAULT;
View Full Code Here

Examples of javax.persistence.IdClass

    }
    final boolean subclassAndSingleTableStrategy = inheritanceState.type == InheritanceType.SINGLE_TABLE
        && inheritanceState.hasParents;
    //process idclass if any
    Set<String> idProperties = new HashSet<String>();
    IdClass idClass = null;
    if ( !inheritanceState.hasParents ) {
      //look for idClass
      XClass current = inheritanceState.clazz;
      InheritanceState state = inheritanceState;
      do {
        current = state.clazz;
        if ( current.isAnnotationPresent( IdClass.class ) ) {
          idClass = current.getAnnotation( IdClass.class );
          break;
        }
        state = InheritanceState.getSuperclassInheritanceState(
            current, inheritanceStatePerClass, mappings.getReflectionManager()
        );
      }
      while ( state != null );
    }
    if ( idClass != null ) {
      XClass compositeClass = mappings.getReflectionManager().toXClass( idClass.value() );
      boolean isComponent = true;
      boolean propertyAnnotated = entityBinder.isPropertyAnnotated( compositeClass );
      String propertyAccessor = entityBinder.getPropertyAccessor( compositeClass );
      String generatorType = "assigned";
      String generator = BinderHelper.ANNOTATION_STRING_DEFAULT;
View Full Code Here

Examples of javax.persistence.IdClass

     * In JPA 2, there is a shortcut if the id class is the Pk of the associated class pointed to by the id
     * it ought to be treated as an embedded and not a real IdClass (at least in the Hibernate's internal way
     */
    XClass classWithIdClass = inheritanceState.getClassWithIdClass( false );
    if ( classWithIdClass != null ) {
      IdClass idClass = classWithIdClass.getAnnotation( IdClass.class );
      XClass compositeClass = mappings.getReflectionManager().toXClass( idClass.value() );
      PropertyData inferredData = new PropertyPreloadedData(
          entityBinder.getPropertyAccessType(), "id", compositeClass
      );
      PropertyData baseInferredData = new PropertyPreloadedData(
          entityBinder.getPropertyAccessType(), "id", classWithIdClass
View Full Code Here

Examples of javax.persistence.IdClass

        && inheritanceState.hasParents();
    //process idclass if any
    Set<String> idProperties = new HashSet<String>();
    XClass classWithIdClass = inheritanceState.getClassWithIdClass(false);
    if ( classWithIdClass != null ) {
      IdClass idClass = classWithIdClass.getAnnotation( IdClass.class );
      XClass compositeClass = mappings.getReflectionManager().toXClass( idClass.value() );
      boolean isComponent = true;
      AccessType propertyAccessor = entityBinder.getPropertyAccessor( compositeClass );
      String generatorType = "assigned";
      String generator = BinderHelper.ANNOTATION_STRING_DEFAULT;
      PropertyData inferredData = new PropertyPreloadedData(
View Full Code Here

Examples of javax.persistence.IdClass

  }

  public XClass getIdentifierTypeIfComponent() {
    final ReflectionManager reflectionManager = mappings.getReflectionManager();
    if ( reflectionManager.equals( identifierType, void.class ) ) {
      IdClass idClass = clazz.getAnnotation( IdClass.class );
      if (idClass != null) {
        identifierType =  reflectionManager.toXClass( idClass.value() );
      }
      else {
        //find @EmbeddedId
        getElementsToProcess();
      }
View Full Code Here

Examples of net.sourceforge.jpaxjc.ns.persistence.orm.IdClass

                    entity.getPrimaryKeyJoinColumn().add( e );
                    acknowledge = true;
                }
                else if ( c.element.getLocalName().equals( "id-class" ) )
                {
                    final IdClass e = JAXB.unmarshal( new DOMSource( c.element ), IdClass.class );
                    entity.setIdClass( e );
                    acknowledge = true;
                }
                else if ( c.element.getLocalName().equals( "inheritance" ) )
                {
View Full Code Here

Examples of net.sourceforge.jpaxjc.ns.persistence.orm.IdClass

                    ms.setDescription( c.element.getFirstChild().getNodeValue() );
                    acknowledge = true;
                }
                else if ( c.element.getLocalName().equals( "id-class" ) )
                {
                    final IdClass e = JAXB.unmarshal( new DOMSource( c.element ), IdClass.class );
                    ms.setIdClass( e );
                    acknowledge = true;
                }
                else if ( c.element.getLocalName().equals( "exclude-default-listeners" ) )
                {
View Full Code Here

Examples of org.apache.openejb.jee.jpa.IdClass

            primaryKeyFields.add(fieldName);
        } else if (bean.getPrimKeyClass() != null) {
            Class<?> pkClass = null;
            try {
                pkClass = classLoader.loadClass(bean.getPrimKeyClass());
                mapping.setIdClass(new IdClass(bean.getPrimKeyClass()));
                for (java.lang.reflect.Field pkField : pkClass.getFields()) {
                    String pkFieldName = pkField.getName();
                    int modifiers = pkField.getModifiers();
                    if (Modifier.isPublic(modifiers) && !Modifier.isStatic(modifiers) && allFields.contains(pkFieldName)) {
                        Field field = new Id(pkFieldName);
View Full Code Here

Examples of org.apache.openejb.jee.jpa.IdClass

                        mapping.addField(new AttributeOverride(fieldName));
                        primaryKeyFields.add(fieldName);
                    }
                }
                if (superclass != null) {
                    superclass.setIdClass(new IdClass(bean.getPrimKeyClass()));
                }
            } catch (ClassNotFoundException e) {
                // todo throw exception
            }
        }
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.