Skip to content

Commit c05c180

Browse files
committed
pushing entities
1 parent 1fcef01 commit c05c180

File tree

4 files changed

+186
-0
lines changed

4 files changed

+186
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.1
2+
3+
use sea_orm::entity::prelude::*;
4+
5+
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
6+
#[sea_orm(table_name = "predicate")]
7+
pub struct Model {
8+
#[sea_orm(primary_key)]
9+
pub id: i32,
10+
pub data: Json,
11+
pub variant: i32,
12+
}
13+
14+
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
15+
pub enum Relation {
16+
#[sea_orm(has_many = "super::predicate_logical_expression_junction::Entity")]
17+
PredicateLogicalExpressionJunction,
18+
#[sea_orm(has_many = "super::predicate_physical_expression_junction::Entity")]
19+
PredicatePhysicalExpressionJunction,
20+
}
21+
22+
impl Related<super::predicate_logical_expression_junction::Entity> for Entity {
23+
fn to() -> RelationDef {
24+
Relation::PredicateLogicalExpressionJunction.def()
25+
}
26+
}
27+
28+
impl Related<super::predicate_physical_expression_junction::Entity> for Entity {
29+
fn to() -> RelationDef {
30+
Relation::PredicatePhysicalExpressionJunction.def()
31+
}
32+
}
33+
34+
impl Related<super::logical_expression::Entity> for Entity {
35+
fn to() -> RelationDef {
36+
super::predicate_logical_expression_junction::Relation::LogicalExpression.def()
37+
}
38+
fn via() -> Option<RelationDef> {
39+
Some(
40+
super::predicate_logical_expression_junction::Relation::Predicate
41+
.def()
42+
.rev(),
43+
)
44+
}
45+
}
46+
47+
impl Related<super::physical_expression::Entity> for Entity {
48+
fn to() -> RelationDef {
49+
super::predicate_physical_expression_junction::Relation::PhysicalExpression.def()
50+
}
51+
fn via() -> Option<RelationDef> {
52+
Some(
53+
super::predicate_physical_expression_junction::Relation::Predicate
54+
.def()
55+
.rev(),
56+
)
57+
}
58+
}
59+
60+
impl ActiveModelBehavior for ActiveModel {}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.1
2+
3+
use sea_orm::entity::prelude::*;
4+
5+
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
6+
#[sea_orm(table_name = "predicate_children")]
7+
pub struct Model {
8+
#[sea_orm(primary_key, auto_increment = false)]
9+
pub parent_id: i32,
10+
#[sea_orm(primary_key, auto_increment = false)]
11+
pub child_id: i32,
12+
}
13+
14+
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
15+
pub enum Relation {
16+
#[sea_orm(
17+
belongs_to = "super::predicate::Entity",
18+
from = "Column::ChildId",
19+
to = "super::predicate::Column::Id",
20+
on_update = "Cascade",
21+
on_delete = "Cascade"
22+
)]
23+
Predicate2,
24+
#[sea_orm(
25+
belongs_to = "super::predicate::Entity",
26+
from = "Column::ParentId",
27+
to = "super::predicate::Column::Id",
28+
on_update = "Cascade",
29+
on_delete = "Cascade"
30+
)]
31+
Predicate1,
32+
}
33+
34+
impl ActiveModelBehavior for ActiveModel {}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.1
2+
3+
use sea_orm::entity::prelude::*;
4+
5+
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
6+
#[sea_orm(table_name = "predicate_logical_expression_junction")]
7+
pub struct Model {
8+
#[sea_orm(primary_key, auto_increment = false)]
9+
pub logical_expr_id: i32,
10+
#[sea_orm(primary_key, auto_increment = false)]
11+
pub predicate_id: i32,
12+
}
13+
14+
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
15+
pub enum Relation {
16+
#[sea_orm(
17+
belongs_to = "super::logical_expression::Entity",
18+
from = "Column::LogicalExprId",
19+
to = "super::logical_expression::Column::Id",
20+
on_update = "Cascade",
21+
on_delete = "Cascade"
22+
)]
23+
LogicalExpression,
24+
#[sea_orm(
25+
belongs_to = "super::predicate::Entity",
26+
from = "Column::PredicateId",
27+
to = "super::predicate::Column::Id",
28+
on_update = "Cascade",
29+
on_delete = "Cascade"
30+
)]
31+
Predicate,
32+
}
33+
34+
impl Related<super::logical_expression::Entity> for Entity {
35+
fn to() -> RelationDef {
36+
Relation::LogicalExpression.def()
37+
}
38+
}
39+
40+
impl Related<super::predicate::Entity> for Entity {
41+
fn to() -> RelationDef {
42+
Relation::Predicate.def()
43+
}
44+
}
45+
46+
impl ActiveModelBehavior for ActiveModel {}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.1
2+
3+
use sea_orm::entity::prelude::*;
4+
5+
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
6+
#[sea_orm(table_name = "predicate_physical_expression_junction")]
7+
pub struct Model {
8+
#[sea_orm(primary_key, auto_increment = false)]
9+
pub physical_expr_id: i32,
10+
#[sea_orm(primary_key, auto_increment = false)]
11+
pub predicate_id: i32,
12+
}
13+
14+
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
15+
pub enum Relation {
16+
#[sea_orm(
17+
belongs_to = "super::physical_expression::Entity",
18+
from = "Column::PhysicalExprId",
19+
to = "super::physical_expression::Column::Id",
20+
on_update = "Cascade",
21+
on_delete = "Cascade"
22+
)]
23+
PhysicalExpression,
24+
#[sea_orm(
25+
belongs_to = "super::predicate::Entity",
26+
from = "Column::PredicateId",
27+
to = "super::predicate::Column::Id",
28+
on_update = "Cascade",
29+
on_delete = "Cascade"
30+
)]
31+
Predicate,
32+
}
33+
34+
impl Related<super::physical_expression::Entity> for Entity {
35+
fn to() -> RelationDef {
36+
Relation::PhysicalExpression.def()
37+
}
38+
}
39+
40+
impl Related<super::predicate::Entity> for Entity {
41+
fn to() -> RelationDef {
42+
Relation::Predicate.def()
43+
}
44+
}
45+
46+
impl ActiveModelBehavior for ActiveModel {}

0 commit comments

Comments
 (0)