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