mirror of
https://github.com/ent/ent.git
synced 2026-05-22 09:31:45 +03:00
entc/gen: fix name clash in entc template when entity name has initials as tx (#2633)
This commit is contained in:
@@ -100,11 +100,11 @@ func (c *City) Update() *CityUpdateOne {
|
||||
// Unwrap unwraps the City 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 *City) Unwrap() *City {
|
||||
tx, ok := c.config.driver.(*txDriver)
|
||||
_tx, ok := c.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: City is not a transactional entity")
|
||||
}
|
||||
c.config.driver = tx.drv
|
||||
c.config.driver = _tx.drv
|
||||
return c
|
||||
}
|
||||
|
||||
|
||||
@@ -116,11 +116,11 @@ func (s *Street) Update() *StreetUpdateOne {
|
||||
// Unwrap unwraps the Street 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 *Street) Unwrap() *Street {
|
||||
tx, ok := s.config.driver.(*txDriver)
|
||||
_tx, ok := s.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Street is not a transactional entity")
|
||||
}
|
||||
s.config.driver = tx.drv
|
||||
s.config.driver = _tx.drv
|
||||
return s
|
||||
}
|
||||
|
||||
|
||||
@@ -85,11 +85,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
|
||||
}
|
||||
|
||||
|
||||
@@ -139,11 +139,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
|
||||
}
|
||||
|
||||
|
||||
@@ -100,11 +100,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
|
||||
}
|
||||
|
||||
|
||||
@@ -108,11 +108,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
|
||||
}
|
||||
|
||||
|
||||
@@ -108,11 +108,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
|
||||
}
|
||||
|
||||
|
||||
@@ -124,11 +124,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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -108,11 +108,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
|
||||
}
|
||||
|
||||
|
||||
@@ -129,11 +129,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
|
||||
}
|
||||
|
||||
|
||||
@@ -127,11 +127,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
|
||||
}
|
||||
|
||||
|
||||
@@ -114,11 +114,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
|
||||
}
|
||||
|
||||
|
||||
@@ -123,11 +123,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
|
||||
}
|
||||
|
||||
|
||||
@@ -134,11 +134,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
|
||||
}
|
||||
|
||||
|
||||
@@ -74,11 +74,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
|
||||
}
|
||||
|
||||
|
||||
@@ -132,11 +132,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
|
||||
}
|
||||
|
||||
|
||||
@@ -74,11 +74,11 @@ func (t *Tenant) Update() *TenantUpdateOne {
|
||||
// Unwrap unwraps the Tenant 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 *Tenant) Unwrap() *Tenant {
|
||||
tx, ok := t.config.driver.(*txDriver)
|
||||
_tx, ok := t.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Tenant is not a transactional entity")
|
||||
}
|
||||
t.config.driver = tx.drv
|
||||
t.config.driver = _tx.drv
|
||||
return t
|
||||
}
|
||||
|
||||
|
||||
@@ -145,11 +145,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
|
||||
}
|
||||
|
||||
|
||||
@@ -127,11 +127,11 @@ func (c *Car) Update() *CarUpdateOne {
|
||||
// Unwrap unwraps the Car 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 *Car) Unwrap() *Car {
|
||||
tx, ok := c.config.driver.(*txDriver)
|
||||
_tx, ok := c.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Car is not a transactional entity")
|
||||
}
|
||||
c.config.driver = tx.drv
|
||||
c.config.driver = _tx.drv
|
||||
return c
|
||||
}
|
||||
|
||||
|
||||
@@ -100,11 +100,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
|
||||
}
|
||||
|
||||
|
||||
@@ -124,11 +124,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
|
||||
}
|
||||
|
||||
|
||||
@@ -132,11 +132,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
|
||||
}
|
||||
|
||||
|
||||
@@ -132,11 +132,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
|
||||
}
|
||||
|
||||
|
||||
@@ -156,11 +156,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
|
||||
}
|
||||
|
||||
|
||||
@@ -83,11 +83,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