2

In the issue 29980421, I found that the code example in the answer include PropertyAccessor and PropertyAccessorFactory. When I check the hibernate-orm project, I found that these classes have been deleted:

org.hibernate.property.PropertyAccessor was deleted at 2015-06-04 15:12:17 GMT-04:00 org.hibernate.property.PropertyAccessorFactory was deleted at 2015-06-04 15:12:17 GMT-04:00

Would anyone give any feedback on this?

If possible, would you provide a running example, replacing the code example in the first answer of In the issue 29980421? How to retrieve a set of member objects using Hibernate?

Edit:

Thank you for your comment. After reading the comment, I removed hibernate 4.x from the question. How about PropertyAccessorFactory?

Community
  • 1
  • 1
salee
  • 189
  • 1
  • 1
  • 9
  • 1
    In Hibernate _4.x_ the `PropertyAccessor` does still exist. You've checked the _master_ (or _5.x_) branch. And in master it was simply replaced by `org.hibernate.property.access.spi.PropertyAccessStrategy` – Tobias Liefke Oct 13 '15 at 12:28

1 Answers1

6

Maybe too late, but now you must choose one of the PropertyAccessStrategy implementations, like PropertyAccessStrategyFieldImpl.

    PropertyAccessStrategy accessor = PropertyAccessStrategyFieldImpl.INSTANCE;
    PropertyAccess access = accessor.buildPropertyAccess(entityClass, "propertyName");
Marcelo Daniel
  • 143
  • 1
  • 7