# Path: spanner_orm/error.py
# class SpannerError(Exception):
# class ValidationError(Exception):
# 
# Path: spanner_orm/registry.py
# class RegistryComponent:
# class Registry(object):
#   def add(self, reference: Type[Any]) -> None:
#   def __init__(self):
#   def _name_from_class(self, klass: Type[Any]) -> str:
#   def register(self, to_register: Type[Any]) -> None:
#   def get(self, name: Union[Type[Any], str]) -> Type[Any]:
# def model_registry():


from typing import Any, Dict, List, Type, Union
from spanner_orm import error
from spanner_orm import registry
import dataclasses
    self.name = None
    self._destination_handle = destination_handle
    self._destination = None
    self._constraints = constraints
    self._is_parent = is_parent
    self._single = single

  @property
  def constraints(self) -> List[RelationshipConstraint]:
    if not self.origin:
      raise error.ValidationError(
          'Origin must be set before constraints is called')
    return self._parse_constraints()

  @property
  def destination(self) -> Type[Any]:
    if not self._destination:
      self._destination = registry.model_registry().get(
          self._destination_handle)
    return self._destination

  @property
  def single(self) -> bool:
    return self._single

  def _parse_constraints(self) -> List[RelationshipConstraint]:
    """Validates the dictionary of constraints and turns it into Conditions."""
    constraints = []
    for origin_column, destination_column in self._constraints.items():
      if origin_column not in self.origin.fields:

# Path: spanner_orm/error.py
# class SpannerError(Exception):
# class ValidationError(Exception):
# 
# Path: spanner_orm/registry.py
# class RegistryComponent:
# class Registry(object):
#   def add(self, reference: Type[Any]) -> None:
#   def __init__(self):
#   def _name_from_class(self, klass: Type[Any]) -> str:
#   def register(self, to_register: Type[Any]) -> None:
#   def get(self, name: Union[Type[Any], str]) -> Type[Any]:
# def model_registry():


# Path: spanner_orm/relationship.py
from typing import Any, Dict, List, Type, Union
from spanner_orm import error
from spanner_orm import registry
import dataclasses

    self.name = None
    self._destination_handle = destination_handle
    self._destination = None
    self._constraints = constraints
    self._is_parent = is_parent
    self._single = single

  @property
  def constraints(self) -> List[RelationshipConstraint]:
    if not self.origin:
      raise error.ValidationError(
          'Origin must be set before constraints is called')
    return self._parse_constraints()

  @property
  def destination(self) -> Type[Any]:
    if not self._destination:
      self._destination = registry.model_registry().get(
          self._destination_handle)
    return self._destination

  @property
  def single(self) -> bool:
    return self._single

  def _parse_constraints(self) -> List[RelationshipConstraint]:
    """Validates the dictionary of constraints and turns it into Conditions."""
    constraints = []
    for origin_column, destination_column in self._constraints.items():
      if origin_column not in self.origin.fields:

        raise error.ValidationError(