dummymaker

Documentation is relative to DummyMaker versions 1+ and 3+.

Content

Exporters

IExporter exporters allow you to export Dummy objects to the shown format via file or as a string.

There are 4 available exporters with different formats:

All Exporters Parameters

Constructor parameters available for all exporters.

Or you can create your own case using ICase interface.

CsvExporter Specific Parameters

SqlExporter Specific Parameters

DataTypeMap is used to extend your data types to export in sql format.

So you can match java class to SQL type. Like map Java Integer to SQL INT type. Using this parameter you can extend or change defaults mapped data types.

Exporters Examples

Exporters allow you to export Dummy objects to shown format as a file or string.

Available formats:

Export demonstration

Exporters with parameters

All Exporters parameters you can find in specified section.

Export as a string

Export as string is useful in case you have custom writer or need to send it over network.

Export File Structures

Examples of exported Dummy object in each format.

Dummy Class Example

public class User {

    @GenInteger
    public Integer id;

    @GenName
    public String name;
}

CSV

Can be used to import data in Cassandra, Mongo, Neo4j, etc…

Csv exporter can generate header. (Like in example below) This option is available to set during instantiating like others.

name,id
ERASMO,1746885991
HELEN,-625322461

JSON

Can be used to import data in Mongo, MySQL, etc…

{
	"User": [
		{
			"name": "GREGORY",
			"id": "-2123372253"
		},
		{
			"name": "HAROLD",
			"id": "-1637387700"
		}
	]
}

XML

Can be used to import data in MySQL, SQL Server, etc…

<UserList>
	<User>
		<name>GREGORY</name>
		<id>-2123372253</id>
	</User>
	<User>
		<name>HAROLD</name>
		<id>-1637387700</id>
	</User>
</UserList>

SQL

Can be executed to load data in any SQL database.

Don’t forget about Primary Key!

Each insert query can contains max 999 rows (Due to 1000 insert row limit in SQL).

CREATE TABLE IF NOT EXISTS user(
	name	VARCHAR,
	id  INT,
	PRIMARY KEY (id)
);

INSERT INTO user (name, id) VALUES 
('GREGORY', -2123372253),
('HAROLD', -1637387700);