|
@@ -161,13 +161,17 @@ impl<T: Entity> AssocMap<T> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /*pub fn get_all(&self) -> DBResult<Vec<T>> {
|
|
|
- query::select_assoc(self)
|
|
|
+ pub fn get_all(&self) -> DBResult<Vec<IDWrap<T>>> {
|
|
|
+ <Self as AssocInterface>::get_all(self)
|
|
|
}
|
|
|
|
|
|
- pub fn insert(&self, value: T) -> DBResult<()> {
|
|
|
- query::insert_assoc(self, value)
|
|
|
- }*/
|
|
|
+ pub fn associate_with(&self, remote_id: T::ID) -> DBResult<()> {
|
|
|
+ <Self as AssocInterface>::associate_with(self, remote_id)
|
|
|
+ }
|
|
|
+
|
|
|
+ pub fn insert(&self, value: T) -> DBResult<T::ID> {
|
|
|
+ <Self as AssocInterface>::insert(self, value)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
impl<T: Entity> EntityMap for AssocMap<T> {
|
|
@@ -235,6 +239,18 @@ impl<R: Relation> AssocDomain<R> {
|
|
|
_ghost: Default::default(),
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ pub fn get_all(&self) -> DBResult<Vec<IDWrap<R::Range>>> {
|
|
|
+ <Self as AssocInterface>::get_all(self)
|
|
|
+ }
|
|
|
+
|
|
|
+ pub fn associate_with(&self, remote_id: <R::Range as Entity>::ID) -> DBResult<()> {
|
|
|
+ <Self as AssocInterface>::associate_with(self, remote_id)
|
|
|
+ }
|
|
|
+
|
|
|
+ pub fn insert(&self, value: R::Range) -> DBResult<<R::Range as Entity>::ID> {
|
|
|
+ <Self as AssocInterface>::insert(self, value)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
impl<R: Relation> AssocInterface for AssocDomain<R> {
|
|
@@ -319,6 +335,18 @@ impl<R: Relation> AssocRange<R> {
|
|
|
_ghost: Default::default(),
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ pub fn get_all(&self) -> DBResult<Vec<IDWrap<R::Domain>>> {
|
|
|
+ <Self as AssocInterface>::get_all(self)
|
|
|
+ }
|
|
|
+
|
|
|
+ pub fn associate_with(&self, remote_id: <R::Domain as Entity>::ID) -> DBResult<()> {
|
|
|
+ <Self as AssocInterface>::associate_with(self, remote_id)
|
|
|
+ }
|
|
|
+
|
|
|
+ pub fn insert(&self, value: R::Domain) -> DBResult<<R::Domain as Entity>::ID> {
|
|
|
+ <Self as AssocInterface>::insert(self, value)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
impl<R: Relation> AssocInterface for AssocRange<R> {
|