本文整理了Java中org.hibernate.property.Getter.getMethod()
方法的一些代码示例,展示了Getter.getMethod()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Getter.getMethod()
方法的具体详情如下:
包路径:org.hibernate.property.Getter
类名称:Getter
方法名:getMethod
[英]Retrieve the getter-method.
Optional operation (return null)
[中]检索getter方法。
可选操作(返回null)
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core
public boolean isMethodOf(Method method) {
for ( int i = 0; i < propertySpan; i++ ) {
final Method getterMethod = getters[i].getMethod();
if ( getterMethod != null && getterMethod.equals( method ) ) {
return true;
}
}
return false;
}
代码示例来源:origin: org.nakedobjects.plugins/hibernate-hibernate
@Test
public void happyCase() {
final UserAccessor accessor = new UserAccessor();
final Getter getter = accessor.getGetter(TestObject.class, PropertyHelper.MODIFIED_BY);
assertNotNull(getter);
assertNull("getMethod", getter.getMethod());
assertNull("getMethodName", getter.getMethodName());
}
代码示例来源:origin: hibernate/hibernate
public boolean isMethodOf(Method method) {
for ( int i=0; i<propertySpan; i++ ) {
final Method getterMethod = getters[i].getMethod();
if ( getterMethod!=null && getterMethod.equals(method) ) return true;
}
return false;
}
代码示例来源:origin: org.nakedobjects.plugins/hibernate-hibernate
@Ignore("need to convert, was originally written for the old value holder design (TextString, etc)")
@Test
public void happyCase() {
obj.setString(expected);
NakedPropertyAccessor accessor = new NakedPropertyAccessor();
Getter getter = accessor.getGetter(SimpleObject.class, "string");
assertNotNull(getter);
assertNull("getMethod", getter.getMethod());
assertNull("getMethodName", getter.getMethodName());
assertEquals("return type", String.class, getter.getReturnType());
}
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate
public boolean isMethodOf(Method method) {
for ( int i = 0; i < propertySpan; i++ ) {
final Method getterMethod = getters[i].getMethod();
if ( getterMethod != null && getterMethod.equals( method ) ) {
return true;
}
}
return false;
}
代码示例来源:origin: org.hibernatespatial/hibernate-spatial
private Method getGetterFor(String property) {
Class cl = this.metadata.getMappedClass(EntityMode.POJO);
Getter getter = ReflectHelper.getGetter(cl, property);
return getter.getMethod();
}
代码示例来源:origin: hibernate/hibernate
Method idGetterMethod = idGetter==null ? null : idGetter.getMethod();
Method idSetterMethod = idSetter==null ? null : idSetter.getMethod();
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate
while ( properties.hasNext() ) {
Property property = (Property) properties.next();
Method method = property.getGetter(clazz).getMethod();
if ( method != null && Modifier.isFinal( method.getModifiers() ) ) {
LOG.gettersOfLazyClassesCannotBeFinal(persistentClass.getEntityName(), property.getName());
Method idGetterMethod = idGetter==null ? null : idGetter.getMethod();
Method idSetterMethod = idSetter==null ? null : idSetter.getMethod();
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core
while ( properties.hasNext() ) {
Property property = (Property) properties.next();
Method method = property.getGetter(clazz).getMethod();
if ( method != null && Modifier.isFinal( method.getModifiers() ) ) {
LOG.gettersOfLazyClassesCannotBeFinal(persistentClass.getEntityName(), property.getName());
Method idGetterMethod = idGetter==null ? null : idGetter.getMethod();
Method idSetterMethod = idSetter==null ? null : idSetter.getMethod();
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate
Method method = getGetter( property ).getMethod();
if ( method != null && Modifier.isFinal( method.getModifiers() ) ) {
LOG.gettersOfLazyClassesCannotBeFinal(entityBinding.getEntity().getName(), property.getAttribute().getName());
Method idGetterMethod = idGetter==null ? null : idGetter.getMethod();
Method idSetterMethod = idSetter==null ? null : idSetter.getMethod();
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core
Method method = getGetter( property ).getMethod();
if ( method != null && Modifier.isFinal( method.getModifiers() ) ) {
LOG.gettersOfLazyClassesCannotBeFinal(entityBinding.getEntity().getName(), property.getAttribute().getName());
Method idGetterMethod = idGetter==null ? null : idGetter.getMethod();
Method idSetterMethod = idSetter==null ? null : idSetter.getMethod();
代码示例来源:origin: org.grails/grails-hibernate
public static GroovyAwareJavassistProxyFactory buildProxyFactory(PersistentClass persistentClass) {
GroovyAwareJavassistProxyFactory proxyFactory = new GroovyAwareJavassistProxyFactory();
@SuppressWarnings("unchecked")
Set<Class<HibernateProxy>> proxyInterfaces = CollectionUtils.newSet(HibernateProxy.class);
final Class<?> javaClass = persistentClass.getMappedClass();
final Property identifierProperty = persistentClass.getIdentifierProperty();
final Getter idGetter = identifierProperty!=null? identifierProperty.getGetter(javaClass) : null;
final Setter idSetter = identifierProperty!=null? identifierProperty.getSetter(javaClass) : null;
if (idGetter == null || idSetter == null) return null;
try {
proxyFactory.postInstantiate(persistentClass.getEntityName(), javaClass, proxyInterfaces,
idGetter.getMethod(), idSetter.getMethod(),
persistentClass.hasEmbeddedIdentifier() ?
(CompositeType) persistentClass.getIdentifier().getType() :
null);
}
catch (HibernateException e) {
LOG.warn("Cannot instantiate proxy factory: " + e.getMessage());
return null;
}
return proxyFactory;
}
内容来源于网络,如有侵权,请联系作者删除!