本文整理了Java中org.hibernate.mapping.Property.getAccessorPropertyName()
方法的一些代码示例,展示了Property.getAccessorPropertyName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Property.getAccessorPropertyName()
方法的具体详情如下:
包路径:org.hibernate.mapping.Property
类名称:Property
方法名:getAccessorPropertyName
暂无
代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all
/**
* Retrieves a PropertyAccessor instance based on the given property definition and
* entity mode.
*
* @param property The property for which to retrieve an accessor.
* @param mode The mode for the resulting entity.
* @return An appropriate accessor.
* @throws MappingException
*/
public static PropertyAccessor getPropertyAccessor(Property property, EntityMode mode) throws MappingException {
//TODO: this is temporary in that the end result will probably not take a Property reference per-se.
if ( null == mode || EntityMode.POJO.equals( mode ) ) {
return getPojoPropertyAccessor( property.getPropertyAccessorName() );
}
else if ( EntityMode.MAP.equals( mode ) ) {
return getDynamicMapPropertyAccessor();
}
else if ( EntityMode.DOM4J.equals( mode ) ) {
//TODO: passing null here, because this method is not really used for DOM4J at the moment
// but it is still a bug, if we don't get rid of this!
return getDom4jPropertyAccessor( property.getAccessorPropertyName( mode ), property.getType(), null );
}
else {
throw new MappingException( "Unknown entity mode [" + mode + "]" );
}
} /**
* Retreives a PropertyAccessor specific for a PojoRepresentation with the given access strategy.
代码示例来源:origin: hibernate/hibernate
/**
* Retrieves a PropertyAccessor instance based on the given property definition and
* entity mode.
*
* @param property The property for which to retrieve an accessor.
* @param mode The mode for the resulting entity.
* @return An appropriate accessor.
* @throws MappingException
*/
public static PropertyAccessor getPropertyAccessor(Property property, EntityMode mode) throws MappingException {
//TODO: this is temporary in that the end result will probably not take a Property reference per-se.
if ( null == mode || EntityMode.POJO.equals( mode ) ) {
return getPojoPropertyAccessor( property.getPropertyAccessorName() );
}
else if ( EntityMode.MAP.equals( mode ) ) {
return getDynamicMapPropertyAccessor();
}
else if ( EntityMode.DOM4J.equals( mode ) ) {
//TODO: passing null here, because this method is not really used for DOM4J at the moment
// but it is still a bug, if we don't get rid of this!
return getDom4jPropertyAccessor( property.getAccessorPropertyName( mode ), property.getType(), null );
}
else {
throw new MappingException( "Unknown entity mode [" + mode + "]" );
}
} /**
* Retreives a PropertyAccessor specific for a PojoRepresentation with the given access strategy.
内容来源于网络,如有侵权,请联系作者删除!