You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] latest
[ ] @next
[x] 0.2.25 (or put your version here)
Steps to reproduce or a small repository showing the problem:
@Entity()exportclassChildEntity{
@PrimaryGeneratedColumn({type: 'bigint'})id: string;}
@Entity()exportclassParentEntity{
@PrimaryGeneratedColumn({type: 'bigint'})id: string;
@OneToOne(()=>ChildEntity,{nullable: true})
@JoinColumn()child: ChildEntity|null;
@RelationId((parent: ParentEntity)=>parent.child)childId: string|null;}constparent=awaitentityManager.getRepository(ParentEntity).findOne(parentId);console.log(parent)// parent.childId will be 'null' if column is null in database
Expected behaviour
childId should be null instead of 'null'
Additional comments
I am getting around this issue by using Column() instead of RelationId()
The text was updated successfully, but these errors were encountered:
Fix issue where attempting to cast bigints to strings also did it for
null values.
Fix issue where transformRelationIds() filtered out null values when
it should only be done for undefined.
Closes: typeorm#6815
Fix issue where attempting to cast bigints to strings also did it for
null values.
Fix issue where transformRelationIds() filtered out null values when
it should only be done for undefined.
Closes: #6815
zaro
pushed a commit
to zaro/typeorm
that referenced
this issue
Jan 12, 2021
Fix issue where attempting to cast bigints to strings also did it for
null values.
Fix issue where transformRelationIds() filtered out null values when
it should only be done for undefined.
Closes: typeorm#6815
Issue type:
[x] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[ ]
mongodb
[ ]
mssql
[ ]
mysql
/mariadb
[ ]
oracle
[x]
postgres
[ ]
cockroachdb
[ ]
sqlite
[ ]
sqljs
[ ]
react-native
[ ]
expo
TypeORM version:
[ ]
latest
[ ]
@next
[x]
0.2.25
(or put your version here)Steps to reproduce or a small repository showing the problem:
Expected behaviour
childId should be
null
instead of'null'
Additional comments
I am getting around this issue by using
Column()
instead ofRelationId()
The text was updated successfully, but these errors were encountered: