Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any Library For Populating Sample Data In Java Object [duplicate]

Tags:

java

I have a java object(pojo bean) which contains some fields and other java object. Is there any library in java which I can use to populate this object?

I want to pass new object to that library and it should return me object with some random data populated inside it.

Lets say if I have employee and department object. Employee has name(string), id(int) and department property. Department has id(int) and name(string) property.

I want this employee object to be populated with some sample data like "abc" for name, 32 for id, etc.

Is this possible or I need to write my own code? Any pointer will help me.

like image 748
Neeraj Avatar asked Oct 04 '13 05:10

Neeraj


1 Answers

My mistake, the question was already being asked at - Fill primitive properties with random data automatically?. It has the solution.

Even if anyone knows better solution please feel free to post it.

like image 62
Neeraj Avatar answered Oct 16 '22 00:10

Neeraj