mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: fix name clash in entc template when entity name has initials as tx (#2633)
This commit is contained in:
@@ -118,11 +118,11 @@ func (c *Card) Update() *CardUpdateOne {
|
||||
// Unwrap unwraps the Card entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (c *Card) Unwrap() *Card {
|
||||
tx, ok := c.config.driver.(*txDriver)
|
||||
_tx, ok := c.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Card is not a transactional entity")
|
||||
}
|
||||
c.config.driver = tx.drv
|
||||
c.config.driver = _tx.drv
|
||||
return c
|
||||
}
|
||||
|
||||
|
||||
@@ -62,11 +62,11 @@ func (c *Comment) Update() *CommentUpdateOne {
|
||||
// Unwrap unwraps the Comment entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (c *Comment) Unwrap() *Comment {
|
||||
tx, ok := c.config.driver.(*txDriver)
|
||||
_tx, ok := c.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Comment is not a transactional entity")
|
||||
}
|
||||
c.config.driver = tx.drv
|
||||
c.config.driver = _tx.drv
|
||||
return c
|
||||
}
|
||||
|
||||
|
||||
@@ -314,11 +314,11 @@ func (ft *FieldType) Update() *FieldTypeUpdateOne {
|
||||
// Unwrap unwraps the FieldType entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (ft *FieldType) Unwrap() *FieldType {
|
||||
tx, ok := ft.config.driver.(*txDriver)
|
||||
_tx, ok := ft.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: FieldType is not a transactional entity")
|
||||
}
|
||||
ft.config.driver = tx.drv
|
||||
ft.config.driver = _tx.drv
|
||||
return ft
|
||||
}
|
||||
|
||||
|
||||
@@ -136,11 +136,11 @@ func (f *File) Update() *FileUpdateOne {
|
||||
// Unwrap unwraps the File entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (f *File) Unwrap() *File {
|
||||
tx, ok := f.config.driver.(*txDriver)
|
||||
_tx, ok := f.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: File is not a transactional entity")
|
||||
}
|
||||
f.config.driver = tx.drv
|
||||
f.config.driver = _tx.drv
|
||||
return f
|
||||
}
|
||||
|
||||
|
||||
@@ -85,11 +85,11 @@ func (ft *FileType) Update() *FileTypeUpdateOne {
|
||||
// Unwrap unwraps the FileType entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (ft *FileType) Unwrap() *FileType {
|
||||
tx, ok := ft.config.driver.(*txDriver)
|
||||
_tx, ok := ft.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: FileType is not a transactional entity")
|
||||
}
|
||||
ft.config.driver = tx.drv
|
||||
ft.config.driver = _tx.drv
|
||||
return ft
|
||||
}
|
||||
|
||||
|
||||
@@ -46,11 +46,11 @@ func (_go *Goods) Update() *GoodsUpdateOne {
|
||||
// Unwrap unwraps the Goods entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (_go *Goods) Unwrap() *Goods {
|
||||
tx, ok := _go.config.driver.(*txDriver)
|
||||
_tx, ok := _go.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Goods is not a transactional entity")
|
||||
}
|
||||
_go.config.driver = tx.drv
|
||||
_go.config.driver = _tx.drv
|
||||
return _go
|
||||
}
|
||||
|
||||
|
||||
@@ -148,11 +148,11 @@ func (gr *Group) Update() *GroupUpdateOne {
|
||||
// Unwrap unwraps the Group entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (gr *Group) Unwrap() *Group {
|
||||
tx, ok := gr.config.driver.(*txDriver)
|
||||
_tx, ok := gr.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Group is not a transactional entity")
|
||||
}
|
||||
gr.config.driver = tx.drv
|
||||
gr.config.driver = _tx.drv
|
||||
return gr
|
||||
}
|
||||
|
||||
|
||||
@@ -80,11 +80,11 @@ func (gi *GroupInfo) Update() *GroupInfoUpdateOne {
|
||||
// Unwrap unwraps the GroupInfo entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (gi *GroupInfo) Unwrap() *GroupInfo {
|
||||
tx, ok := gi.config.driver.(*txDriver)
|
||||
_tx, ok := gi.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: GroupInfo is not a transactional entity")
|
||||
}
|
||||
gi.config.driver = tx.drv
|
||||
gi.config.driver = _tx.drv
|
||||
return gi
|
||||
}
|
||||
|
||||
|
||||
@@ -50,11 +50,11 @@ func (i *Item) Update() *ItemUpdateOne {
|
||||
// Unwrap unwraps the Item entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (i *Item) Unwrap() *Item {
|
||||
tx, ok := i.config.driver.(*txDriver)
|
||||
_tx, ok := i.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Item is not a transactional entity")
|
||||
}
|
||||
i.config.driver = tx.drv
|
||||
i.config.driver = _tx.drv
|
||||
return i
|
||||
}
|
||||
|
||||
|
||||
@@ -103,11 +103,11 @@ func (n *Node) Update() *NodeUpdateOne {
|
||||
// Unwrap unwraps the Node entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (n *Node) Unwrap() *Node {
|
||||
tx, ok := n.config.driver.(*txDriver)
|
||||
_tx, ok := n.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Node is not a transactional entity")
|
||||
}
|
||||
n.config.driver = tx.drv
|
||||
n.config.driver = _tx.drv
|
||||
return n
|
||||
}
|
||||
|
||||
|
||||
@@ -116,11 +116,11 @@ func (pe *Pet) Update() *PetUpdateOne {
|
||||
// Unwrap unwraps the Pet entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (pe *Pet) Unwrap() *Pet {
|
||||
tx, ok := pe.config.driver.(*txDriver)
|
||||
_tx, ok := pe.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Pet is not a transactional entity")
|
||||
}
|
||||
pe.config.driver = tx.drv
|
||||
pe.config.driver = _tx.drv
|
||||
return pe
|
||||
}
|
||||
|
||||
|
||||
@@ -72,11 +72,11 @@ func (s *Spec) Update() *SpecUpdateOne {
|
||||
// Unwrap unwraps the Spec entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (s *Spec) Unwrap() *Spec {
|
||||
tx, ok := s.config.driver.(*txDriver)
|
||||
_tx, ok := s.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Spec is not a transactional entity")
|
||||
}
|
||||
s.config.driver = tx.drv
|
||||
s.config.driver = _tx.drv
|
||||
return s
|
||||
}
|
||||
|
||||
|
||||
@@ -51,11 +51,11 @@ func (t *Task) Update() *TaskUpdateOne {
|
||||
// Unwrap unwraps the Task entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (t *Task) Unwrap() *Task {
|
||||
tx, ok := t.config.driver.(*txDriver)
|
||||
_tx, ok := t.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Task is not a transactional entity")
|
||||
}
|
||||
t.config.driver = tx.drv
|
||||
t.config.driver = _tx.drv
|
||||
return t
|
||||
}
|
||||
|
||||
|
||||
@@ -299,11 +299,11 @@ func (u *User) Update() *UserUpdateOne {
|
||||
// Unwrap unwraps the User entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (u *User) Unwrap() *User {
|
||||
tx, ok := u.config.driver.(*txDriver)
|
||||
_tx, ok := u.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: User is not a transactional entity")
|
||||
}
|
||||
u.config.driver = tx.drv
|
||||
u.config.driver = _tx.drv
|
||||
return u
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user