public <T> ObjectAdapter firstMatchingQuery(final Query<T> query) {
return getAdapterMap().adapterFor(context.firstMatchingQuery(query));
}
};
this.adapterMap = new AdapterMapAbstract() {
@Override
public ObjectAdapter adapterFor(final Object domainObject) {
final ObjectSpecification domainObjectSpec = getSpecificationLookup().loadSpecification(domainObject.getClass());
final PersistenceState persistenceState = context.getPersistenceState(domainObject);
return new StandaloneAdapter(domainObjectSpec, domainObject, persistenceState);