impl EntityTrait

This commit is contained in:
Chris Tsang 2021-05-19 20:07:57 +08:00
parent 70a1559c60
commit 0c4b69e3b3
9 changed files with 10 additions and 80 deletions

View File

@ -27,16 +27,6 @@ pub enum Relation {
CakeFilling, CakeFilling,
} }
impl EntityTrait for Entity {
type Model = Model;
type Column = Column;
type PrimaryKey = PrimaryKey;
type Relation = Relation;
}
impl ColumnTrait for Column { impl ColumnTrait for Column {
type EntityName = Entity; type EntityName = Entity;

View File

@ -28,16 +28,6 @@ pub enum Relation {
Filling, Filling,
} }
impl EntityTrait for Entity {
type Model = Model;
type Column = Column;
type PrimaryKey = PrimaryKey;
type Relation = Relation;
}
impl ColumnTrait for Column { impl ColumnTrait for Column {
type EntityName = Entity; type EntityName = Entity;

View File

@ -24,16 +24,6 @@ pub enum PrimaryKey {
#[derive(Copy, Clone, Debug, EnumIter)] #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {} pub enum Relation {}
impl EntityTrait for Entity {
type Model = Model;
type Column = Column;
type PrimaryKey = PrimaryKey;
type Relation = Relation;
}
impl ColumnTrait for Column { impl ColumnTrait for Column {
type EntityName = Entity; type EntityName = Entity;

View File

@ -26,16 +26,6 @@ pub enum PrimaryKey {
#[derive(Copy, Clone, Debug, EnumIter)] #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {} pub enum Relation {}
impl EntityTrait for Entity {
type Model = Model;
type Column = Column;
type PrimaryKey = PrimaryKey;
type Relation = Relation;
}
impl ColumnTrait for Column { impl ColumnTrait for Column {
type EntityName = Entity; type EntityName = Entity;

View File

@ -39,5 +39,15 @@ pub fn expend_derive_entity(ident: Ident, attrs: Vec<Attribute>) -> syn::Result<
write!(s, "{}", self.as_str()).unwrap(); write!(s, "{}", self.as_str()).unwrap();
} }
} }
impl EntityTrait for #ident {
type Model = Model;
type Column = Column;
type PrimaryKey = PrimaryKey;
type Relation = Relation;
}
)) ))
} }

View File

@ -28,16 +28,6 @@ pub enum Relation {
CakeFilling, CakeFilling,
} }
impl EntityTrait for Entity {
type Model = Model;
type Column = Column;
type PrimaryKey = PrimaryKey;
type Relation = Relation;
}
impl ColumnTrait for Column { impl ColumnTrait for Column {
type EntityName = Entity; type EntityName = Entity;

View File

@ -29,16 +29,6 @@ pub enum Relation {
Filling, Filling,
} }
impl EntityTrait for Entity {
type Model = Model;
type Column = Column;
type PrimaryKey = PrimaryKey;
type Relation = Relation;
}
impl ColumnTrait for Column { impl ColumnTrait for Column {
type EntityName = Entity; type EntityName = Entity;

View File

@ -25,16 +25,6 @@ pub enum PrimaryKey {
#[derive(Copy, Clone, Debug, EnumIter)] #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {} pub enum Relation {}
impl EntityTrait for Entity {
type Model = Model;
type Column = Column;
type PrimaryKey = PrimaryKey;
type Relation = Relation;
}
impl ColumnTrait for Column { impl ColumnTrait for Column {
type EntityName = Entity; type EntityName = Entity;

View File

@ -27,16 +27,6 @@ pub enum PrimaryKey {
#[derive(Copy, Clone, Debug, EnumIter)] #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {} pub enum Relation {}
impl EntityTrait for Entity {
type Model = Model;
type Column = Column;
type PrimaryKey = PrimaryKey;
type Relation = Relation;
}
impl ColumnTrait for Column { impl ColumnTrait for Column {
type EntityName = Entity; type EntityName = Entity;