mirror of
https://github.com/google/nomulus
synced 2026-06-09 16:33:02 +00:00
Make Joda Money embeddable in entities (#340)
This commit is contained in:
@@ -72,7 +72,7 @@ final class CreateDomainCommand extends CreateOrUpdateDomainCommand
|
||||
!force || forcePremiums,
|
||||
"Forced creates on premium domain(s) require --force_premiums");
|
||||
Money createCost = prices.getCreateCost();
|
||||
currency = createCost.getCurrencyUnit().getCurrencyCode();
|
||||
currency = createCost.getCurrencyUnit().getCode();
|
||||
cost = createCost.multipliedBy(period).getAmount().toString();
|
||||
System.out.printf(
|
||||
"NOTE: %s is premium at %s per year; sending total cost for %d year(s) of %s %s.\n",
|
||||
|
||||
18
core/src/main/resources/META-INF/orm.xml
Normal file
18
core/src/main/resources/META-INF/orm.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<entity-mappings xmlns="http://xmlns.jcp.org/xml/ns/persistence/orm"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence/orm
|
||||
http://xmlns.jcp.org/xml/ns/persistence/orm_2_2.xsd"
|
||||
version="2.2">
|
||||
<embeddable class="org.joda.money.Money" access="FIELD">
|
||||
<attributes>
|
||||
<embedded name="money" access="FIELD"/>
|
||||
</attributes>
|
||||
</embeddable>
|
||||
<embeddable class="org.joda.money.BigMoney" access="FIELD">
|
||||
<attributes>
|
||||
<basic name="amount" access="FIELD"/>
|
||||
<basic name="currency" access="FIELD"/>
|
||||
</attributes>
|
||||
</embeddable>
|
||||
</entity-mappings>
|
||||
Reference in New Issue
Block a user