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

org.jadira.usertype.dateandtime.joda.PersistentDateTimeAsUtcString Maven / Gradle / Ivy

/*
 *  Copyright 2013 Christopher Pheby
 *
 *  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.
 */
package org.jadira.usertype.dateandtime.joda;

import org.jadira.usertype.dateandtime.joda.columnmapper.StringColumnDateTimeMapper;
import org.jadira.usertype.spi.shared.AbstractParameterizedUserType;
import org.joda.time.DateTime;

/**
 * Persist {@link DateTime} as a string of three parts:
 * 
    *
  • the {@code DateTime} transformed into UTC time, formatted as such: {@code yyyy-MM-dd'T'HH:mm:ss.SSS}
  • *
  • the underscore symbol (_)
  • *
  • the id of the {@code DateTime}'s original time zone (for example Europe/London or UTC)
  • *
* This user-type was created to workaround Hibernate's HHH-5574 * bug by storing the complete {@code DateTime} data, including the specific time zone, not just the offset (ala ISO 8601), in * one single, sortable field. * @author dwijnand */ public class PersistentDateTimeAsUtcString extends AbstractParameterizedUserType { private static final long serialVersionUID = 6477950463426162426L; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy