Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将字段从具有特定注释的entities类映射到Java中的其他POJO字段_Java_Pojo_Entities_Dropwizard Guice - Fatal编程技术网

将字段从具有特定注释的entities类映射到Java中的其他POJO字段

将字段从具有特定注释的entities类映射到Java中的其他POJO字段,java,pojo,entities,dropwizard-guice,Java,Pojo,Entities,Dropwizard Guice,我们定义了数据库中的实体,为了表示多语言属性,我们在几个实体字段上添加了注释。现在,我们在这些实体的基础上构建了几个API,它们有自己的pojo。 例如: 如果客户是实体类 class Customer{ String customerId; @Multilingual String firstName; String lastName; //other fields }* 现在,我们有几个get API,它们将结果返回到我们的UI,例如:fetchCustome

我们定义了数据库中的实体,为了表示多语言属性,我们在几个实体字段上添加了注释。现在,我们在这些实体的基础上构建了几个API,它们有自己的pojo。 例如: 如果客户是实体类

class Customer{
   String customerId;
   @Multilingual
   String firstName;
   String lastName;
   //other fields
}*
现在,我们有几个get API,它们将结果返回到我们的UI,例如:fetchCustomerDetails API

CustomerResponse{
   List[] Customers;
   //other fields
   List[]orders;
}
现在,当它收到一个调用时,我们从db获取数据并准备CustomerResponse。 现在我还想发出带有响应的元数据

{
  "multilingualSupport": {
    "customer": [
      "firstname"
    ]
  }
}
现在,我如何将实体注释字段映射到CustomerResponse并在API响应中添加元数据