All Downloads are FREE. Search and download functionalities are using the official Maven repository.

us.datanucleus-jodatime.4.1.2.source-code.plugin.xml Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<!--**********************************************************************
Copyright (c) 2009 Andy Jefferson and others. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Contributors:
    ...
**********************************************************************-->
<plugin id="org.datanucleus.store.types.jodatime" name="DataNucleus JodaTime" provider-name="DataNucleus">

    <!-- JAVA TYPES -->
    <extension point="org.datanucleus.java_type">
        <java-type name="org.joda.time.DateTime" dfg="true" embedded="true" converter-name="dn.joda-datetime-timestamp"/>
        <java-type name="org.joda.time.LocalDate" dfg="true" embedded="true" converter-name="dn.joda-localdate-sqldate"/>
        <java-type name="org.joda.time.LocalDateTime" dfg="true" embedded="true" converter-name="dn.joda-localdatetime-timestamp"/>
        <java-type name="org.joda.time.LocalTime" dfg="true" embedded="true" converter-name="dn.joda-localtime-sqltime"/>
        <java-type name="org.joda.time.Duration" dfg="true" embedded="true" converter-name="dn.joda-duration-string"/>
        <java-type name="org.joda.time.Interval" dfg="true" embedded="true" converter-name="dn.joda-interval-string"/>
        <java-type name="org.joda.time.Period" dfg="true" embedded="true" converter-name="dn.joda-period-string"/>
    </extension>

    <!-- TYPE CONVERTERS -->
    <extension point="org.datanucleus.type_converter">
        <type-converter name="dn.joda-datetime-string" member-type="org.joda.time.DateTime" datastore-type="java.lang.String"
            converter-class="org.datanucleus.store.types.jodatime.converters.JodaDateTimeStringConverter"/>
        <type-converter name="dn.joda-datetime-timestamp" member-type="org.joda.time.DateTime" datastore-type="java.sql.Timestamp"
            converter-class="org.datanucleus.store.types.jodatime.converters.JodaDateTimeTimestampConverter"/>

        <type-converter name="dn.joda-localdate-string" member-type="org.joda.time.LocalDate" datastore-type="java.lang.String"
            converter-class="org.datanucleus.store.types.jodatime.converters.JodaLocalDateStringConverter"/>
        <type-converter name="dn.joda-localdate-sqldate" member-type="org.joda.time.LocalDate" datastore-type="java.sql.Date"
            converter-class="org.datanucleus.store.types.jodatime.converters.JodaLocalDateSqlDateConverter"/>

        <type-converter name="dn.joda-localtime-string" member-type="org.joda.time.LocalTime" datastore-type="java.lang.String"
            converter-class="org.datanucleus.store.types.jodatime.converters.JodaLocalTimeStringConverter"/>
        <type-converter name="dn.joda-localtime-sqltime" member-type="org.joda.time.LocalTime" datastore-type="java.sql.Time"
            converter-class="org.datanucleus.store.types.jodatime.converters.JodaLocalTimeSqlTimeConverter"/>

        <type-converter name="dn.joda-localdatetime-string" member-type="org.joda.time.LocalDateTime" datastore-type="java.lang.String"
            converter-class="org.datanucleus.store.types.jodatime.converters.JodaLocalDateTimeStringConverter"/>
        <type-converter name="dn.joda-localdatetime-timestamp" member-type="org.joda.time.LocalDateTime" datastore-type="java.sql.Timestamp"
            converter-class="org.datanucleus.store.types.jodatime.converters.JodaLocalDateTimeTimestampConverter"/>

        <type-converter name="dn.joda-duration-string" member-type="org.joda.time.Duration" datastore-type="java.lang.String"
            converter-class="org.datanucleus.store.types.jodatime.converters.JodaDurationStringConverter"/>
        <type-converter name="dn.joda-duration-long" member-type="org.joda.time.Duration" datastore-type="java.lang.Long"
            converter-class="org.datanucleus.store.types.jodatime.converters.JodaDurationLongConverter"/>

        <type-converter name="dn.joda-interval-string" member-type="org.joda.time.Interval" datastore-type="java.lang.String"
            converter-class="org.datanucleus.store.types.jodatime.converters.JodaIntervalStringConverter"/>
        <type-converter name="dn.joda-interval-timestamps" member-type="org.joda.time.Interval" datastore-type="[Ljava.sql.Timestamp;"
            converter-class="org.datanucleus.store.types.jodatime.converters.JodaIntervalTimestampsConverter"/>

        <type-converter name="dn.joda-period-string" member-type="org.joda.time.Period" datastore-type="java.lang.String"
            converter-class="org.datanucleus.store.types.jodatime.converters.JodaPeriodStringConverter"/>
    </extension>

    <!-- QUERY INMEMORY METHODS -->
    <extension point="org.datanucleus.query_method_evaluators">
        <query-method-evaluator class="org.joda.time.Interval" method="getStart" evaluator="org.datanucleus.store.types.jodatime.query.inmemory.IntervalGetStartMethod"/>
        <query-method-evaluator class="org.joda.time.Interval" method="getEnd" evaluator="org.datanucleus.store.types.jodatime.query.inmemory.IntervalGetEndMethod"/>
    </extension>

    <!-- RDBMS : JAVA TYPES MAPPING -->
    <extension point="org.datanucleus.store.rdbms.java_mapping">
        <!-- TODO Aim to remove this when we can get RDBMS query process to work with TypeConverterMultiMapping -->
        <mapping java-type="org.joda.time.Interval" mapping-class="org.datanucleus.store.types.jodatime.rdbms.mapping.JodaIntervalMapping"/>
    </extension>

    <!-- RDBMS : SQL EXPRESSIONS -->
    <extension point="org.datanucleus.store.rdbms.sql_expression">
        <sql-expression mapping-class="org.datanucleus.store.types.jodatime.rdbms.mapping.JodaIntervalMapping" 
            literal-class="org.datanucleus.store.types.jodatime.rdbms.sql.expression.JodaIntervalLiteral"
            expression-class="org.datanucleus.store.rdbms.sql.expression.StringTemporalExpression"/>
    </extension>
    
    <!-- RDBMS : SQL METHODS -->
    <extension point="org.datanucleus.store.rdbms.sql_method">
        <sql-method class="org.joda.time.Interval" method="getStart" evaluator="org.datanucleus.store.types.jodatime.rdbms.sql.method.IntervalGetStartMethod"/>
        <sql-method class="org.joda.time.Interval" method="getEnd" evaluator="org.datanucleus.store.types.jodatime.rdbms.sql.method.IntervalGetEndMethod"/>            
    </extension>
</plugin>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy