Package javax.persistence

Examples of javax.persistence.ManyToMany.targetEntity()


          collectionBinder.setOneToMany( true );
        }
        else if ( manyToManyAnn != null ) {
          mappedBy = manyToManyAnn.mappedBy();
          collectionBinder.setTargetEntity(
              mappings.getReflectionManager().toXClass( manyToManyAnn.targetEntity() )
          );
          collectionBinder.setCascadeStrategy(
              getCascadeStrategy(
                  manyToManyAnn.cascade(), hibernateCascade, false, false
              )
View Full Code Here


        collectionBinder.setOneToMany( true );
      }
      else if ( manyToManyAnn != null ) {
        mappedBy = manyToManyAnn.mappedBy();
        collectionBinder.setTargetEntity(
            mappings.getReflectionManager().toXClass( manyToManyAnn.targetEntity() )
        );
        collectionBinder.setCascadeStrategy( getCascadeStrategy( manyToManyAnn.cascade(), hibernateCascade ) );
        collectionBinder.setOneToMany( false );
      }
      else if ( property.isAnnotationPresent( ManyToAny.class ) ) {
View Full Code Here

        collectionBinder.setOneToMany( true );
      }
      else if ( manyToManyAnn != null ) {
        mappedBy = manyToManyAnn.mappedBy();
        collectionBinder.setTargetEntity(
            mappings.getReflectionManager().toXClass( manyToManyAnn.targetEntity() )
        );
        collectionBinder.setCascadeStrategy( getCascadeStrategy( manyToManyAnn.cascade(), hibernateCascade, false) );
        collectionBinder.setOneToMany( false );
      }
      else if ( property.isAnnotationPresent( ManyToAny.class ) ) {
View Full Code Here

      JoinColumn[] tos = join.inverseJoinColumns();
      if (tos == null || tos.length == 0)
        continue;

      Class<?> tarClass = ann.targetEntity();
      String relTable = join.name();
      String tarIdField = ORMConfigBeanUtil.getIdField(tarClass);

      Object _tarObj = null;
      try {
View Full Code Here

        DAOFactory.getUpdateDAO(dsName).updateBySQLWithArgs(sql,
            fromVal);
      } else {
        // 删除指定关联的记录
        String to = tos[0].name();
        Class<?> tarClass = ann.targetEntity();
        // "delete from {relTable} where {from} = {fromVal} and to = {toVal}"
        String _format = "delete from %s where %s = ? and %s = ?";
        for (int i = 0; i < tarList.size(); i++) {
          Object tarObj = tarList.get(i);
          if (tarObj == null)
View Full Code Here

      JoinColumn[] tos = join.inverseJoinColumns();
      if (tos == null || tos.length == 0)
        continue;

      // 多对多关系目标Class
      Class<?> tarClass = ann.targetEntity();
      String tarTable = ORMConfigBeanUtil.getTable(tarClass);
      // 目标类对应的数据库表Id字段
      String tarIdColumn = ORMConfigBeanUtil.getIdColumn(tarClass);
      // 目标类在第三方关系表中的字段名
      String to = tos[0].name();
View Full Code Here

   
          JoinColumn[] tos = join.inverseJoinColumns();
          if (tos == null || tos.length == 0)
            continue;
   
          Class<?> tarClass = ann.targetEntity();
          if (void.class.isAssignableFrom(tarClass)) {
            tarClass = ClassUtil.getGenericType(f);
          }
          String relTable = join.name();
          String tarIdField = ORMConfigBeanUtil.getIdField(tarClass);
View Full Code Here

        // 删除所有关联记录
        DAOFactory.getUpdateDAO(dsName).updateBySQLWithArgs(sql,idVal);
      } else {
        // 删除指定关联的记录
        String to = tos[0].name();
        Class<?> tarClass = ann.targetEntity();
        if (void.class.isAssignableFrom(tarClass)) {
          tarClass = ClassUtil.getGenericType(f);
        }
       
        // "delete from {relTable} where {from} = {idVal} and to = {toVal}"
View Full Code Here

      JoinColumn[] tos = join.inverseJoinColumns();
      if (tos == null || tos.length == 0)
        continue;

      // 多对多关系目标Class
      Class<?> tarClass = ann.targetEntity();
      if (void.class.isAssignableFrom(tarClass)) {
        tarClass = ClassUtil.getGenericType(f);
      }
     
      String tarTable = ORMConfigBeanUtil.getTable(tarClass);
View Full Code Here

          collectionBinder.setOneToMany( true );
        }
        else if ( manyToManyAnn != null ) {
          mappedBy = manyToManyAnn.mappedBy();
          collectionBinder.setTargetEntity(
              mappings.getReflectionManager().toXClass( manyToManyAnn.targetEntity() )
          );
          collectionBinder.setCascadeStrategy(
              getCascadeStrategy(
                  manyToManyAnn.cascade(), hibernateCascade, false, false
              )
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.