Package org.hibernate.mapping

Examples of org.hibernate.mapping.Value


  }

  public String generateJoinColumnsAnnotation(Property property, Configuration cfg) {
    boolean insertable = property.isInsertable();
    boolean updatable = property.isUpdateable();
    Value value = property.getValue();
    int span;
    Iterator columnIterator;
    Iterator referencedColumnsIterator = null;
    if (value != null && value instanceof Collection) {
      Collection collection = (Collection) value;
View Full Code Here


    }
    return cascade.toString();
  }

  public String getFetchType(Property property) {
    Value value = property.getValue();
    String fetchType = importType( "javax.persistence.FetchType");
    boolean lazy = false;
    if ( value instanceof ToOne ) {
      lazy = ( (ToOne) value ).isLazy();
    }
View Full Code Here

    return clazz;
  }

  public String generateCollectionAnnotation(Property property, Configuration cfg) {
    StringBuffer annotation = new StringBuffer();
    Value value = property.getValue();
    if ( value != null && value instanceof Collection) {
      Collection collection = (Collection) value;
      if ( collection.isOneToMany() ) {
        String mappedBy = null;
        AnnotationBuilder ab = AnnotationBuilder.createAnnotation( importType( "javax.persistence.OneToMany") );
View Full Code Here

    //TODO we should check the table too
    boolean isOtherSide = false;
    mappedBy = "unresolved";
    while ( ! isOtherSide && properties.hasNext() ) {
      Property collectionProperty = (Property) properties.next();
      Value collectionValue = collectionProperty.getValue();
      if ( collectionValue != null && collectionValue instanceof Collection ) {
        Collection realCollectionValue = (Collection) collectionValue;
        if ( ! realCollectionValue.isOneToMany() ) {
          if ( joinColumns.size() == realCollectionValue.getElement().getColumnSpan() ) {
            isOtherSide = true;
View Full Code Here

    //TODO we should check the table too
    boolean isOtherSide = false;
    mappedBy = "unresolved";
    while ( ! isOtherSide && properties.hasNext() ) {
      Property manyProperty = (Property) properties.next();
      Value manyValue = manyProperty.getValue();
      if ( manyValue != null && manyValue instanceof ManyToOne ) {
        if ( joinColumns.size() == manyValue.getColumnSpan() ) {
          isOtherSide = true;
          Iterator it = manyValue.getColumnIterator();
          while ( it.hasNext() ) {
            Object column = it.next();
            if (! joinColumns.contains( column ) ) {
              isOtherSide = false;
              break;
View Full Code Here

            }
            addPropertiesToList(cmd, prefix, cursorPosition, hcc);           
        } else {
            String baseEntityName = path.substring(0, idx);
            String propertyPath = path.substring(idx + 1);
            Value value = getNextAttributeType(baseEntityName, propertyPath);
            if (value == null) {
                return;
            }
           
            // Go to the next property (get the y of x/y/z when root is x)
View Full Code Here

    if(value instanceof ToOne) {
      return ((ToOne)value).getReferencedEntityName();
    }
    if ( value instanceof Collection ) {
      Collection collection = ((Collection)value);
      Value element = collection.getElement();
      String elementType = getReferencedEntityName( element );
      if(collection.isIndexed()) {
        //TODO..list/map
        /*IndexedCollection idxCol = (IndexedCollection) collection;
        if(!idxCol.isList()) {
View Full Code Here

    return new String( chars );
  }


  public boolean isComponent(Property property) {
    Value value = property.getValue();
    if ( value != null && value instanceof Component ) {
      return true;
    }
    else {
      return false;
View Full Code Here

    mappedBy = "unresolved";


    while ( ! isOtherSide && properties.hasNext() ) {
      Property oneProperty = (Property) properties.next();
      Value manyValue = oneProperty.getValue();
      if ( manyValue != null && ( manyValue instanceof OneToOne || manyValue instanceof ManyToOne ) ) {
        if ( joinColumns.size() == manyValue.getColumnSpan() ) {
          isOtherSide = true;
          Iterator it = manyValue.getColumnIterator();
          while ( it.hasNext() ) {
            Object column = it.next();
            if (! joinColumns.contains( column ) ) {
              isOtherSide = false;
              break;
View Full Code Here

    return result;
  }

  private boolean isFormula(Property field) {
    Value value = field.getValue();
    boolean foundFormula = false;

    if(value!=null && value.getColumnSpan()>0) {
      Iterator columnIterator = value.getColumnIterator();
      while ( columnIterator.hasNext() ) {
        Selectable element = (Selectable) columnIterator.next();
        if(!(element instanceof Formula)) {
          return false;
        } else {
View Full Code Here

TOP

Related Classes of org.hibernate.mapping.Value

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.