Hibernate ORM DateTypeDescriptor - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM DateTypeDescriptor class.

This code example shows how to use the following methods:
 * Converts a {@link Date} into a {@link String} representing a timestamp. 
 * @author Davide D'Alto <davide@hibernate.org> 
public class TimestampDateTypeDescriptor extends DateTypeDescriptor {
	public static final TimestampDateTypeDescriptor INSTANCE = new TimestampDateTypeDescriptor();
	public Date fromString(String string) {
		return CalendarTimeZoneDateTimeTypeDescriptor.INSTANCE.fromString( string ).getTime();
	public String toString(Date value) {
		Calendar cal = Calendar.getInstance();
		cal.setTime( value );
		return CalendarTimeZoneDateTimeTypeDescriptor.INSTANCE.toString( cal );