//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; # [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; impl EntityName for Entity { fn table_name (& self) -> & str { "product_sales_channels" } } # [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub product_id : String , pub sales_channel_id : String , } # [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { ProductId , SalesChannelId , } # [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { ProductId , SalesChannelId , } impl PrimaryKeyTrait for PrimaryKey { type ValueType = (String , String) ; fn auto_increment () -> bool { false } } # [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { Products , SalesChannels , } impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: ProductId => ColumnType :: String (None) . def () , Self :: SalesChannelId => ColumnType :: String (None) . def () , } } } impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: Products => Entity :: belongs_to (super :: products :: Entity) . from (Column :: ProductId) . to (super :: products :: Column :: Id) . into () , Self :: SalesChannels => Entity :: belongs_to (super :: sales_channels :: Entity) . from (Column :: SalesChannelId) . to (super :: sales_channels :: Column :: Id) . into () , } } } impl Related < super :: products :: Entity > for Entity { fn to () -> RelationDef { Relation :: Products . def () } } impl Related < super :: sales_channels :: Entity > for Entity { fn to () -> RelationDef { Relation :: SalesChannels . def () } } impl ActiveModelBehavior for ActiveModel { }