Skip to content

ClassNotMappedException with super class mapped #18

Closed
@gcamaraomarques

Description

@gcamaraomarques

I'm using RelationalJMapper in my Spring Boot Project, and I have this classes.
using your example names to help understanding

class PivotI extends AbstractPivotI {
    // no attributes on this class
    // methods
}

class abstract AbstractPivotI {
    Integer id;
}

class BoI extends AbstractBoI {
    // no attributes too
    // some methods
}

class abstract AbstractBoI {
    @JMap(attributes={"id"}
          classes   ={PivotI.class })
    Integer boIfield;
}

class Magic {
    public void whereTheMagicHappens() {
        //some magic code 
        PivotI source = new PivotI(1);
        RelationalJMapper<BoI> mapper = new RelationalJMapper<BoI>(BoI.class);
        BoI destination = mapper.manyToOne(source);
        //more magic code
    }
}

When I try to use the method whereTheMagicHappens the RelationalJMapper.init() throws a ClassNotMappedException.

I'm not sure if it's a problem to you, but to use your mapper I added a attribute never used in both classes and annotated with @JMap.

Thanks for the mapper it's helping alot and if you need any information to help just ask.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions