I am using Telosys templates to generate code for data entities. I used template where I can generate entity classes with links i.e. with relationships to other entities. However the DTO records generated do not have the links mapped correctly i.e. in entity class if there is ManytoOne relationship and collection as returntype from the getter, the same is not reflected in DTO record.
Is there any other template available or any change that I should do in the existing Record template?
Appreciate any help.
Question part 2 based on comment from @Igu I have generated entities like this:
//--- ENTITY LINKS ( RELATIONSHIP )
@OneToMany(fetch = FetchType.EAGER, mappedBy="mcophy", targetEntity=Pgnphy.class)
private Collection<Pgnphy> listOfPgnphy ;
@OneToMany(fetch = FetchType.EAGER, mappedBy="mcophy", targetEntity=Pgaphy.class)
private Collection<Pgaphy> listOfPgaphy ;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name="aiawtx", referencedColumnName="afawtx", insertable=false, updatable=false)
private Stnphy stnphy ;
which is as expected. However when I am generating my DTOs they are something like this:
//----------------------------------------------------------------------
// ENTITY LINKS ( RELATIONSHIP )
//----------------------------------------------------------------------
private List<PgaphyDTO> listOfPgaphy ;
private Stnphy stnphy ;
private List<PgnphyDTO> listOfPgnphy ;
wherein I was expecting the second link be like:
private StnphyDTO stnphyDTO;
I used
private ${link.formattedFieldType(10).trim().replace(">","DTO>")} $link.formattedFieldName(12) ;
what am I not doing right?