Example usage for org.hibernate.mapping Property getName

List of usage examples for org.hibernate.mapping Property getName

Introduction

In this page you can find the example usage for org.hibernate.mapping Property getName.

Prototype

public String getName() 

Source Link

Usage

From source file:org.eclipse.emf.teneo.hibernate.tuplizer.EMFComponentTuplizer.java

License:Open Source License

@Override
protected Getter buildGetter(Component component, Property mappedProperty) {
    return getPropertyAccessor(mappedProperty, component).getGetter(null, mappedProperty.getName());
}

From source file:org.eclipse.emf.teneo.hibernate.tuplizer.EMFComponentTuplizer.java

License:Open Source License

@Override
protected Setter buildSetter(Component component, Property mappedProperty) {
    return getPropertyAccessor(mappedProperty, component).getSetter(null, mappedProperty.getName());
}

From source file:org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.java

License:Open Source License

@Override
protected Getter buildPropertyGetter(Property mappedProperty, PersistentClass mappedEntity) {
    if (HbUtil.isEAVMapped(mappedEntity) && mappedProperty.getName().equals(Constants.EAV_EOBJECT_VALUES)) {
        final HbDataStore ds = HbHelper.INSTANCE.getDataStore(mappedEntity);
        final Getter getter = mappedProperty.getGetter(EObjectImpl.class);
        if (getter instanceof EAVPropertyHandler) {
            ((EAVPropertyHandler) getter).setHbDataStore(ds);
        }/*from w w w  .  ja  v  a  2s.c  o  m*/
        return getter;
    }
    return getPropertyAccessor(mappedProperty, mappedEntity).getGetter(null, mappedProperty.getName());
}

From source file:org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.java

License:Open Source License

@Override
protected Setter buildPropertySetter(Property mappedProperty, PersistentClass mappedEntity) {
    if (HbUtil.isEAVMapped(mappedEntity) && mappedProperty.getName().equals(Constants.EAV_EOBJECT_VALUES)) {
        final HbDataStore ds = HbHelper.INSTANCE.getDataStore(mappedEntity);
        final Setter setter = mappedProperty.getSetter(EObjectImpl.class);
        if (setter instanceof EAVPropertyHandler) {
            ((EAVPropertyHandler) setter).setHbDataStore(ds);
        }//ww w . java 2  s .  c  o m
        return setter;
    }
    return getPropertyAccessor(mappedProperty, mappedEntity).getSetter(null, mappedProperty.getName());
}

From source file:org.hiberframe.HibUtils.java

License:Open Source License

public static String getIdPropertyName(Class<?> clazz) {
    PersistentClass persistentClass = findPersistentClass(clazz, true);
    Property property = persistentClass.getIdentifierProperty();
    return property.getName();
}

From source file:org.hiberframe.HibUtils.java

License:Open Source License

public static String getIdPropertyNameIfPersistent(Class<?> clazz) {
    PersistentClass persistentClass = findPersistentClass(clazz, false);
    if (persistentClass == null)
        return null;
    Property property = persistentClass.getIdentifierProperty();
    return property.getName();
}

From source file:org.jboss.tools.hibernate.ui.diagram.editors.model.OrmShape.java

License:Open Source License

public Shape getChild(Property ormElement) {
    if (ormElement == null) {
        return null;
    }//from   w ww  . ja  v a  2  s  .c o  m
    Iterator<Shape> it = getChildrenIterator();
    while (it.hasNext()) {
        final Shape child = it.next();
        Object childElement = child.getOrmElement();
        if (childElement instanceof Property
                && ormElement.getName().equals(((Property) childElement).getName())) {
            return child;
        }
    }
    return null;
}

From source file:org.jboss.tools.hibernate.ui.diagram.editors.model.Utils.java

License:Open Source License

public static String getName(Object obj) {
    String res = ""; //$NON-NLS-1$
    if (obj instanceof PersistentClass) {
        PersistentClass rootClass = (PersistentClass) obj;
        if (rootClass.getEntityName() != null) {
            res = rootClass.getEntityName();
        } else {/*from  ww  w  .  j av  a 2 s  .  c  om*/
            res = rootClass.getClassName();
        }
    } else if (obj instanceof Table) {
        res = getTableName((Table) obj);
    } else if (obj instanceof Property) {
        Property property = (Property) obj;
        res = getName(property.getPersistentClass()) + "." + property.getName(); //$NON-NLS-1$
    } else if (obj instanceof SimpleValue) {
        SimpleValue sv = (SimpleValue) obj;
        res = getTableName(sv.getTable()) + "." + sv.getForeignKeyName(); //$NON-NLS-1$
    } else if (obj instanceof String) {
        res = (String) obj;
    }
    if (res.length() > 0 && res.indexOf(".") < 0) { //$NON-NLS-1$
        return "default." + res; //$NON-NLS-1$
    }
    if (res.length() == 0) {
        res = "null"; //$NON-NLS-1$
    }
    return res;
}

From source file:org.jspresso.framework.model.persistence.hibernate.entity.tuplizer.DynamicPojoEntityTuplizer.java

License:Open Source License

/**
 * {@inheritDoc}/*  ww  w.j av  a  2 s  .  co m*/
 */
@Override
protected Getter buildPropertyGetter(Property mappedProperty, PersistentClass mappedEntity) {
    return new EntityPropertyAccessor().getGetter(mappedEntity.getMappedClass(), mappedProperty.getName());
}

From source file:org.jspresso.framework.model.persistence.hibernate.entity.tuplizer.DynamicPojoEntityTuplizer.java

License:Open Source License

/**
 * {@inheritDoc}/*from w  ww . jav a2 s.com*/
 */
@Override
protected Setter buildPropertySetter(Property mappedProperty, PersistentClass mappedEntity) {
    return new EntityPropertyAccessor().getSetter(mappedEntity.getMappedClass(), mappedProperty.getName());
}