mirror of https://github.com/apache/openjpa.git
OPENJPA-2555 rename DBDictionary property to dateFractionDigits
dateFractionDigits is more self-explaning than defaultFractionDigits. It also fits better into the already existing date* config settings.
This commit is contained in:
parent
dc31b800b8
commit
a7969c120b
|
@ -451,9 +451,9 @@ public class DBDictionary
|
|||
* This value is only being used if no explicit {@code @Column(scale=n)} is set or n is zero.
|
||||
* Use {@code @Column(scale=-1)} to disable the explicit fraction part in the SQL generator.
|
||||
* @see #fractionalTypeNameSet
|
||||
* @see #getFractionLength(Column, String)
|
||||
* @see #getDateFractionDigits(Column, String)
|
||||
*/
|
||||
public int defaultFractionLength = 6;
|
||||
public int dateFractionDigits = 6;
|
||||
|
||||
|
||||
protected final Set<String> typeModifierSet = new HashSet<>();
|
||||
|
@ -2009,7 +2009,7 @@ public class DBDictionary
|
|||
colSize = col.getDecimalDigits() == -1 ? 0 : col.getDecimalDigits();
|
||||
}
|
||||
else {
|
||||
colSize = getFractionLength(col, typeName);
|
||||
colSize = getDateFractionDigits(col, typeName);
|
||||
}
|
||||
size = "(" + colSize + ")";
|
||||
} else if (colSize > 0) {
|
||||
|
@ -2030,8 +2030,8 @@ public class DBDictionary
|
|||
* @return the fraction length of types which have a fraction
|
||||
* @see #fractionalTypeNameSet
|
||||
*/
|
||||
protected int getFractionLength(Column col, String typeName) {
|
||||
return defaultFractionLength;
|
||||
protected int getDateFractionDigits(Column col, String typeName) {
|
||||
return dateFractionDigits;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -166,7 +166,7 @@ public class MariaDBDictionary extends DBDictionary {
|
|||
|
||||
fixedSizeTypeNameSet.remove("NUMERIC");
|
||||
|
||||
defaultFractionLength = 0;
|
||||
dateFractionDigits = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -167,7 +167,7 @@ public class MySQLDictionary
|
|||
|
||||
fixedSizeTypeNameSet.remove("NUMERIC");
|
||||
|
||||
defaultFractionLength = 0;
|
||||
dateFractionDigits = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -33,7 +33,7 @@ public class TestMixedMappingLocation extends SingleEMFTestCase {
|
|||
@Override
|
||||
public void setUp() {
|
||||
setUp(DROP_TABLES,
|
||||
"openjpa.jdbc.DBDictionary", "(defaultFractionLength=6)",
|
||||
"openjpa.jdbc.DBDictionary", "(dateFractionDigits=6)",
|
||||
MixedMappingLocationEmbeddedId.class, MixedMappingLocation.class);
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -41,7 +41,7 @@ public class TestExplicitAccess extends SingleEMFTestCase {
|
|||
@Override
|
||||
public void setUp() {
|
||||
setUp(CLEAR_TABLES,
|
||||
"openjpa.jdbc.DBDictionary", "(defaultFractionLength=6)",
|
||||
"openjpa.jdbc.DBDictionary", "(dateFractionDigits=6)",
|
||||
PropAccess.class, FieldAccess.class,
|
||||
DefFieldMixedPropAccess.class , DefPropMixedFieldAccess.class,
|
||||
AbstractMappedSuperField.class, PropertySub.class,
|
||||
|
|
|
@ -34,7 +34,7 @@ public class TestXMLExplicitAccess extends SingleEMFTestCase {
|
|||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp(CLEAR_TABLES,
|
||||
"openjpa.jdbc.DBDictionary", "(defaultFractionLength=6)");
|
||||
"openjpa.jdbc.DBDictionary", "(dateFractionDigits=6)");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ public class TestMany2ManyMapEx10 extends SQLListenerTestCase {
|
|||
@Override
|
||||
public void setUp() {
|
||||
super.setUp(DROP_TABLES,
|
||||
"openjpa.jdbc.DBDictionary", "(defaultFractionLength=6)",
|
||||
"openjpa.jdbc.DBDictionary", "(dateFractionDigits=6)",
|
||||
EmployeePK.class, PhonePK.class,
|
||||
Employee.class, PhoneNumber.class);
|
||||
createObj();
|
||||
|
|
|
@ -39,7 +39,7 @@ public class TestHintedQuery extends SQLListenerTestCase {
|
|||
@Override
|
||||
public void setUp() {
|
||||
super.setUp(CLEAR_TABLES,
|
||||
"openjpa.jdbc.DBDictionary", "(defaultFractionLength=6)",
|
||||
"openjpa.jdbc.DBDictionary", "(dateFractionDigits=6)",
|
||||
TimeKeeper.class);
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ public class TestTemporalTypeQueryParameterBinding extends SingleEMFTestCase {
|
|||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp(CLEAR_TABLES,
|
||||
"openjpa.jdbc.DBDictionary", "(defaultFractionLength=6)",
|
||||
"openjpa.jdbc.DBDictionary", "(dateFractionDigits=6)",
|
||||
TimeKeeper.class, TimeEntity.class);
|
||||
em = emf.createEntityManager();
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ public class TestSimpleXmlEntity
|
|||
@Override
|
||||
public void setUp() {
|
||||
setUp(CLEAR_TABLES,
|
||||
"openjpa.jdbc.DBDictionary", "(defaultFractionLength=6)",
|
||||
"openjpa.jdbc.DBDictionary", "(dateFractionDigits=6)",
|
||||
org.apache.openjpa.persistence.embed.attrOverrides.AnnoOverEmbed.class);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public class TestXmlOverrideEntity extends SingleEMFTestCase {
|
|||
@Override
|
||||
public void setUp() throws ClassNotFoundException {
|
||||
setUp(CLEAR_TABLES,
|
||||
"openjpa.jdbc.DBDictionary", "(defaultFractionLength=6)",
|
||||
"openjpa.jdbc.DBDictionary", "(dateFractionDigits=6)",
|
||||
org.apache.openjpa.persistence.embed.attrOverrides.AnnoOverEmbed.class);
|
||||
|
||||
// make sure that XmlOverrideEntity is registered for our metadata tests
|
||||
|
|
Loading…
Reference in New Issue