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

Mapping nested class #84

Open
STValeo opened this issue Sep 13, 2018 · 0 comments
Open

Mapping nested class #84

STValeo opened this issue Sep 13, 2018 · 0 comments

Comments

@STValeo
Copy link

STValeo commented Sep 13, 2018

Hi there
I've started to use jmapper recently and I'm just wondering if it's possible to do what I'm trying to do ahah

`------------ SRC FOLDER ------------------------------

public class Container
{
    private Subscription subscription;
}
 
@Entity
public class Subscription
{
    @Id
    @JMap
    private String subscriptionUid;
 
    @ManyToOne("service_uid")
    private Service service;
}
 
@Entity
public class Service
{
    @Id
    @JMap
    private String serviceUid;
 
    @JMap
    private String serviceName;
 
   
}
 
-----------------------------------------------------
---------------- DESTINATION FOLDER -----------------
 
public class Foobar
{
    @JMap
    private String service_name;
 
    @JMap
    private String subscription_uid;
}
 
public class ResponseDto
{
    private Foobar suscription;
}
 
 
---------------------------------------------------
 
 
actual output with an object with following:
SOURCE AS =====>
Container
{
    subscription class Subscription
    {
        subscription_uid = "9843-324872-98273";
        service class Service
        {
            service_uid = "876876-998798-987987";
            service_name = "myServiceName"
        }
    }
}
 
AND DESTINATION IS
 
ResponseDto
{
    suscription class Foobar
    {
        subscription_uid = "9843-324872-98273"
        service_name = null
    }
}`
 
How's that possible ? why my nested class property are not mapped inside the destination ? Did I need to annotate something else ?

anyone can tell me why during mapping to destination why my property is not filled as well as this property is inside a nested class in the source
thanks :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant