Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

160
Vistas
How to keep helper methods after join in Typeorm?

I have 2 entities

@Entity()
class UserEntity {
  @OneToOne()
  book: BookEntity;
}

and

@Entity()
class BookEntity {
 public myCustomMethod(): boolean {
  return true;
 }
}

When I join UserEntity and BookEntity I lose myCustomMethod and calling it like user.book.myCustomMethod throws myCustomMethod is not a function.

Basically I think the join fills user.book as plain javascript object and not new BookEntity().

Is there anyway to keep it?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda