manufacturePojo only works with camelCase variables?

40 views
Skip to first unread message

mkwyche

unread,
Nov 12, 2016, 5:18:42 PM11/12/16
to PODAM
Ran into a bug while trying to use your product figured I'd report it. Beans seem to get filled fine when using traditional camel case variable names. But if you don't use camel case variable names the bean will not be filled. Any suggestions on how to fix this? Attached is a sample unit test showing the issue and below is the output:

SampleBean [name=29GVrSpfSf]
SampleBean2 [Name=null]
PodamBug.java

Daniil Ivanov

unread,
Nov 13, 2016, 4:38:10 PM11/13/16
to PODAM
Your Pojo#2 violates Java's naming conventions
http://www.oracle.com/technetwork/java/codeconventions-135099.html
How come this is a Podam's bug?

mkwyche

unread,
Nov 14, 2016, 5:11:21 AM11/14/16
to PODAM
Daniil,

I see what you're saying but why does the POJO need to correspond Java's naming conventions. The class is still fine, it compiles and is usable. If I use those sames POJO's to get functionality out of tools like Jackson/Gson/BeanUtils etc... all the functionality still works fine. 

I ran into this because the POJO I had was a model object for some data in a database. So the names of the variables were lined up with the Names coming out of the Database object. 

Could I write a massager or use anotations to control this another way yes, but this also seems like something PODAM should be able to handle.  

Daniil Ivanov

unread,
Nov 14, 2016, 2:08:43 PM11/14/16
to PODAM
You should override AbstractClassInfoStrategy.findPojoAttributes()

Thanks, Daniil

mkwyche

unread,
Nov 15, 2016, 12:56:21 AM11/15/16
to PODAM
Thanks!
Reply all
Reply to author
Forward
0 new messages