I'm using Minuteproject to generate my JPA2 entities.
I use the GUI by running .start-console.sh. and enter all my db connection and package details.
It generates all my classes but with each class package as follows.
package com.fantasy.entities.defautmodel.domain.defautmodel;
I want the following.
package com.fantasy.entities;
Any ideas on how I can change this?!
Each minuteproject artefacts has some metadata associated to it. In the case of JPA2 artefact the name is 'DomainEntityJPA2Annotation'. The metadata definitions are found in the mp-template-config-JPA2.xml.
<template name="DomainEntityJPA2Annotation" templateFileName="DomainEntityJPA2Annotation.vm"
subdir="" outputsubdir="" technicalPackage="domain" ...
The metadata attribute 'technicalPackage' deals with technical package definition of the artifact. It is coded to 'domain' value, but in your case you would like to have 'entities' instead. So you have to adapt the technical package directory here. If you do so, I advise you to adapt the technical package for DomainEntityJPA2Metamodel (JPA2 metamodel), DomainEntityJPA2EmbeddedId (for embedded Id) and EnumerationReferenceDataJPA2 (for enumeration) replacing 'domain' by 'entities' where necessary.
For the moment there is no convention (yet) in minuteproject main config to change technical package.
So why do technical package needed?
It is a way to classify among the different stacks, where other tracks dependent of JPA2 can generate upon (ex: DAO, JSF ...).
Business package
Alongside technical, minuteproject add the notion of business package, it is a way to gather your entities per business aspect (admin, finance, ...)
If you do not add any business package it gives the package of the model. If you do not provide any model name (like on the example on the console) then the default model name 'defaultmodel' is given.
I hope it helps.