func (query *Query) PropertyOrError(prop Property) (*PropertyQuery, error) {
	if query.entity.id != prop.entityId() {
		return nil, fmt.Errorf("property from a different entity %d passed, expected %d", prop.entityId(), query.entity.id)
	}
	return newPropertyQuery(query, prop.propertyId())
}
PropertyOrError is just like Property except it returns a potential error instead of issuing a panic.
package objectbox
import "C"
import (
	"errors"
	"fmt"
	"runtime"
	"sync"
	"unsafe"
)
type Query struct {
	entity          *entity
	objectBox       *ObjectBox
	box             *Box
	cQuery          *C.OBX_query
	closeMutex      sync.Mutex
	offsetErr       error
	limitErr        error
	linkedEntityIds []TypeId
}
func (query *Query) Close() error {
	query.closeMutex.Lock()
	defer query.closeMutex.Unlock()
	if query.cQuery != nil {
		return cCall(func() C.obx_err {
			var err = C.obx_query_close(query.cQuery)
			query.cQuery = nil
			runtime.SetFinalizer(query, nil)  
			return err
		})
	}
	return nil
}
func queryFinalizer(query *Query) {
	err := query.Close()
	if err != nil {
		fmt.Printf("Error in Query finalizer: %s", err)
	}
}
func (query *Query) installFinalizer() {
	runtime.SetFinalizer(query, queryFinalizer)
}
func (query *Query) check() error {
	if query.cQuery == nil {
		return errors.New("illegal state; query was closed")
	} else if query.limitErr != nil {
		return query.limitErr
	} else if query.offsetErr != nil {
		return query.offsetErr
	}
	return nil
}
func (query *Query) Property(prop Property) *PropertyQuery {
	pq, err := query.PropertyOrError(prop)
	if err != nil {
		panic(fmt.Sprintf("Could not create query - please check your query conditions: %s", err))
	}
	return pq
}