// -*- C++ -*-
//
// This file was generated by ODB, object-relational mapping (ORM)
// compiler for C++.
//

namespace odb
{
}

namespace odb
{
  // _version
  //

  inline
  bool access::composite_value_traits< ::bpkg::_version, id_sqlite >::
  get_null (const image_type& i)
  {
    bool r (true);
    r = r && i.epoch_null;
    r = r && i.canonical_upstream_null;
    r = r && i.canonical_release_null;
    r = r && i.revision_null;
    r = r && i.iteration_null;
    r = r && i.upstream_null;
    r = r && i.release_null;
    return r;
  }

  inline
  void access::composite_value_traits< ::bpkg::_version, id_sqlite >::
  set_null (image_type& i,
            sqlite::statement_kind sk)
  {
    ODB_POTENTIALLY_UNUSED (sk);

    using namespace sqlite;

    i.epoch_null = true;
    i.canonical_upstream_null = true;
    i.canonical_release_null = true;
    i.revision_null = true;
    i.iteration_null = true;
    i.upstream_null = true;
    i.release_null = true;
  }

  // canonical_version
  //

  inline
  bool access::composite_value_traits< ::bpkg::canonical_version, id_sqlite >::
  get_null (const image_type& i)
  {
    bool r (true);
    r = r && i.epoch_null;
    r = r && i.canonical_upstream_null;
    r = r && i.canonical_release_null;
    r = r && i.revision_null;
    r = r && i.iteration_null;
    return r;
  }

  inline
  void access::composite_value_traits< ::bpkg::canonical_version, id_sqlite >::
  set_null (image_type& i,
            sqlite::statement_kind sk)
  {
    ODB_POTENTIALLY_UNUSED (sk);

    using namespace sqlite;

    i.epoch_null = true;
    i.canonical_upstream_null = true;
    i.canonical_release_null = true;
    i.revision_null = true;
    i.iteration_null = true;
  }

  // original_version
  //

  inline
  bool access::composite_value_traits< ::bpkg::original_version, id_sqlite >::
  get_null (const image_type& i)
  {
    bool r (true);
    r = r && i.upstream_null;
    r = r && i.release_null;
    return r;
  }

  inline
  void access::composite_value_traits< ::bpkg::original_version, id_sqlite >::
  set_null (image_type& i,
            sqlite::statement_kind sk)
  {
    ODB_POTENTIALLY_UNUSED (sk);

    using namespace sqlite;

    i.upstream_null = true;
    i.release_null = true;
  }

  // package_id
  //

  inline
  bool access::composite_value_traits< ::bpkg::package_id, id_sqlite >::
  get_null (const image_type& i)
  {
    bool r (true);
    r = r && i.name_null;
    r = r && composite_value_traits< ::bpkg::canonical_version, id_sqlite >::get_null (i.version_value);
    return r;
  }

  inline
  void access::composite_value_traits< ::bpkg::package_id, id_sqlite >::
  set_null (image_type& i,
            sqlite::statement_kind sk)
  {
    ODB_POTENTIALLY_UNUSED (sk);

    using namespace sqlite;

    i.name_null = true;
    composite_value_traits< ::bpkg::canonical_version, id_sqlite >::set_null (i.version_value, sk);
  }
}

