Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orika converting entity class to HashMap when fetch entity fetched from DB. #183

Open
GoogleCodeExporter opened this issue Jan 1, 2016 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. I just simply fetched entity from the database(Spring Data and Neo4J).


What is the expected output? What do you see instead?
I am expecting a Entity but getting hashmap instead.


What version of the product are you using? On what operating system?
Orika 1.4.5 on Windows 8.1, Java 8, Spring 4, Spring Data(ORM) and Neo4j(DB)

Please provide any additional information below.
I am using custom converter. I am able to convert UserDTO to User but when I am 
fetching the entity by ID its throwing class cast exception. Full Stack trace: 

[code]
SEVERE: Servlet.service() for servlet [dispatcher] in context with path 
[/spring4neo] threw exception [Request processing failed; nested exception is 
java.lang.ClassCastException: java.util.HashMap cannot be cast to 
net.paxcel.entities.User] with root cause
java.lang.ClassCastException: java.util.HashMap cannot be cast to 
net.paxcel.entities.User
    at net.paxcel.converters.UserDtoToUserConvertor.convert(UserDtoToUserConvertor.java:33)
    at net.paxcel.converters.UserDtoToUserConvertor.convert(UserDtoToUserConvertor.java:1)
    at ma.glasnost.orika.generated.Orika_Post_PostDto_Mapper494794926963038$0.mapAtoB(Orika_Post_PostDto_Mapper494794926963038$0.java)
    at ma.glasnost.orika.impl.mapping.strategy.UseCustomMapperStrategy.map(UseCustomMapperStrategy.java:67)
    at ma.glasnost.orika.impl.MapperFacadeImpl.map(MapperFacadeImpl.java:735)
    at ma.glasnost.orika.impl.MapperFacadeImpl.map(MapperFacadeImpl.java:714)
    at net.paxcel.converters.orika.MyConfigurableMapper.map(MyConfigurableMapper.java:85)
    at net.paxcel.converters.PostConvertor.toEntity(PostConvertor.java:55)
    at net.paxcel.service.impl.PostServiceImpl.save(PostServiceImpl.java:36)
[/code]




Original issue reported on code.google.com by [email protected] on 21 Nov 2014 at 3:34

@GoogleCodeExporter
Copy link
Author

Can you please add Unit test ?

Original comment by [email protected] on 20 Dec 2014 at 5:37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant