当前位置:网站首页>Entity class conversion cannot be reassigned
Entity class conversion cannot be reassigned
2022-06-11 08:17:00 【Want Xiaoxin】
When calling other projects, it is found that the field of the accepting entity class is null
The reason is that the entity class being converted is set 
lombok Of set Method defaults to uppercase , After the method shown in the figure is set, only set
or get A lowercase letter .
Solution 1
Manual switching , Under an entity class conversion interface , Write a conversion method to call .
But because , The company's project is automatically converted. You only need to write out the source entity class and the receiving entity class 
use gradle Conduct build Then the method can be generated automatically . But this conversion method can not solve the problem . So write the method application under this interface defulat Custom method , You can write your own code without automatic generation 
Solution 2
Check the data and find that there is a kind of @Mapping Advanced usage of 
You can use the automatic conversion of the project , The application concept is similar to Mybatis The specified db Conversion between fields and objects .
But then there was another problem , This method can only convert classes , Can't turn List.
So write another one for List Can be called 
边栏推荐
- Node error report sorting
- torch. Var (), sample variance, parent variance
- Js学习基础document.write在页面中写一行文字
- TypeScript-类型别名
- (transformation) tree, binary tree and forest transformation principle
- Typescript namespace
- TRUNC in pytorch_ normal_ principle
- Solve ('You must install pydot (`pip install pydot`) and install graphviz (see...) '‘ for plot_ model..
- Collation of basic knowledge of intermediate development of Andrews (for interview)
- (taking pytorch as an example) a simple understanding of the regularization method of path (depth) -drop path
猜你喜欢

学习《缠解论语》

Record a murder case caused by ignoring the @suppresslint ("newapi") prompt

Crawl Baidu Baipin dynamic page

Deep understanding of add in argparse module_ Argument parameters (such as action)

Sign in system design: how to draw the sign in function

Bladed入门教程(视频)
![Socket [5] - struct linker usage](/img/e5/bce5d89c61a3a4f89171734ca6ff8e.png)
Socket [5] - struct linker usage

(transformation) tree, binary tree and forest transformation principle

Using Tkinter to realize guessing numbers game

TypeScript-头文件使用细节
随机推荐
Socket [5] - struct linker usage
TypeScript-接口和类型别名异同
2022.6.6 extra long growth simulation
uniapp关闭/开启/调节系统声音
Summary of force deduction questions
通过ComponentCallbacks2来接收onTrimMemory等回调,并mock对应的场景
Typescript interface and type alias similarities and differences
彻底记住ImageView的background和src的区别
Note: JDBC
C. Manipulating History(贪心/哈希/思维/好题)
这几个小工具也太好用了
Typescript recognizable Union
(resolved) pychart debug error -unicode decodeerror: 'UTF-8' codec can't decode byte 0xe8 in position 1023
Understanding of Poisson distribution and Poisson process and Erlang distribution and their relations (important theories in queuing theory and operational research)
Thoroughly remember the difference between ImageView background and SRC
Several ways to avoid concurrent modification exceptions of lists
Solve ('You must install pydot (`pip install pydot`) and install graphviz (see...) '‘ for plot_ model..
Solve cannot import name 'multiheadattention' from 'tensorflow keras. layers‘
Introduction to guava cache usage
Receive ontrimmemory and other callbacks through componentcallbacks2 and mock the corresponding scenario