]
Antonio Goncalves reassigned FORGE-2098:
----------------------------------------
Assignee: Antonio Goncalves
Being able to create a new JPA converter
----------------------------------------
Key: FORGE-2098
URL:
https://issues.jboss.org/browse/FORGE-2098
Project: Forge
Issue Type: Sub-task
Components: Java EE
Affects Versions: 2.12.1.Final
Reporter: Antonio Goncalves
Assignee: Antonio Goncalves
Fix For: 2.x Future
It would be good to be able to create a new JPA converter with just the following command
:
{code}
jpa-new-converter --name CreditCardConverter --fromAttribute CreditCard --toColumn
String
{code}
This will generate the following code :
{code}
@Converter(autoApply = true)
public class CreditCardConverter implements AttributeConverter<CreditCard, String>
{
@Override
public String convertToDatabaseColumn(CreditCard entityAttribute) {
return null;
}
@Override
public CreditCard convertToEntityAttribute(String databaseColumn) {
return null;
}
}
{code}
(!) This command is only available in JPA 2.1