use std::marker::PhantomData;
use crate::prelude::{ColumnType, PrimaryKeyEntity};
use crate::relations::macros::{default_relation_function, sql_impl_for_relation};
#[derive(Debug)]
pub struct OneToOne<T: PrimaryKeyEntity<P>, P: ColumnType> {
_p: PhantomData<T>,
pub target_id: P,
}
impl<T: PrimaryKeyEntity<P>, P: ColumnType> OneToOne<T, P> {
default_relation_function!(OneToOne);
}
sql_impl_for_relation!(OneToOne);
#[derive(Debug)]
pub struct OneToOneRef<T: PrimaryKeyEntity<P>, P: ColumnType> {
_p: PhantomData<T>,
_p1: PhantomData<P>,
}
impl<T: PrimaryKeyEntity<P>, P: ColumnType> OneToOneRef<T, P> {
pub fn new() -> OneToOneRef<T, P> {
OneToOneRef { _p: PhantomData, _p1: PhantomData }
}
}