Package javax.persistence

Examples of javax.persistence.OneToOne.mappedBy()


          ann.optional(),
          getFetchMode( ann.fetch() ),
          ignoreNotFound, onDeleteCascade,
          mappings.getReflectionManager().toXClass( ann.targetEntity() ),
          propertyHolder,
          inferredData, ann.mappedBy(), trueOneToOne, isIdentifierMapper, inSecondPass, mappings
      );
    }
    else if ( property.isAnnotationPresent( org.hibernate.annotations.Any.class ) ) {

      //check validity
View Full Code Here


        }
        if (propertyDescriptor.isAnnotationPresent(OneToOne.class)) {
          OneToOne oneToOne = propertyDescriptor.getAnnotation(OneToOne.class);
          CascadeType[] cascades = oneToOne.cascade();
          FetchType fetchType = oneToOne.fetch();
          String mappedBy = oneToOne.mappedBy();

          this.checkCascade(collection, oneToOne, beanDescriptor, propertyDescriptor, cascades);
          this.checkFetch(collection, oneToOne, beanDescriptor, propertyDescriptor, fetchType);

          if (ConditionUtils.isEmpty(mappedBy)) {
View Full Code Here

          oneAnn = f.getAnnotation(OneToOne.class);
        }

        if (oneAnn != null) {
          p.setType(PropType.ONE);
          p.setColumn(oneAnn.mappedBy());
        }
      }

      pList.add(p);
    }
View Full Code Here

            continue;
        }
        Class<?> cls = f.getType();
        if (fkClass != null) {
          if (fkClass.isAssignableFrom(cls)) {
            String fk = oneAnn.mappedBy();
            result.add(fk);
            break;
          }
        } else {
          String fk = oneAnn.mappedBy();
View Full Code Here

            String fk = oneAnn.mappedBy();
            result.add(fk);
            break;
          }
        } else {
          String fk = oneAnn.mappedBy();
          result.add(fk);
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

              else
                p.setColumn(f.getName() + "_" + refCol);
            } else
              p.setColumn(joinColumn.name());
          }
          String relProperty = oneAnn.mappedBy();
          if (relProperty == null || relProperty.trim().length() == 0)
            relProperty = ORMConfigBeanUtil.getIdField(f.getType());

          p.setRelProperty(relProperty);
          p.setRelClass(f.getType());
View Full Code Here

        Method tarIdGetter = tarRu.getGetter(tarIdField);
        Object tarIdValObj = tarIdGetter.invoke(tarObj);
        if (tarIdValObj == null)
          continue;

        String column = ann.mappedBy();

        String sql = String.format(format, table, column, idColumn);
        DAOFactory.getUpdateDAO(dsName).updateBySQLWithArgs(sql,
            tarIdValObj, idVal);
View Full Code Here

          // from {table} where {idColumn} = {idVal})
          String format = "select * from %s where %s = (select %s from %s where %s = %s )";
          String tarTable = ORMConfigBeanUtil.getTable(tarClass);
          String tarIdColumn = ORMConfigBeanUtil
              .getIdColumn(tarClass);
          String column = ann.mappedBy();
          String sql = String.format(format, tarTable, tarIdColumn,
              column, table, idColumn, idVal);
          List<?> tarList = DAOFactory.getSelectDAO(dsName)
              .selectBySQL(tarClass, sql);
          if (tarList == null || tarList.size() == 0)
View Full Code Here

            getFetchMode( ann.fetch() ),
            ignoreNotFound, onDeleteCascade,
            ToOneBinder.getTargetEntity( inferredData, mappings ),
            propertyHolder,
            inferredData,
            ann.mappedBy(),
            trueOneToOne,
            isIdentifierMapper,
            inSecondPass,
            propertyBinder,
            mappings
View Full Code Here

        }
      }
      else {
        OneToOne oneToOneAnn = property.getAnnotation( OneToOne.class );
        String mappedBy = oneToOneAnn != null ?
            oneToOneAnn.mappedBy() :
            null;
        joinColumns = Ejb3JoinColumn.buildJoinColumns(
            (JoinColumn[]) null,
            mappedBy, entityBinder.getSecondaryTables(),
            propertyHolder, inferredData.getPropertyName(), mappings
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.