Example usage for javax.persistence TemporalType TIMESTAMP

List of usage examples for javax.persistence TemporalType TIMESTAMP

Introduction

In this page you can find the example usage for javax.persistence TemporalType TIMESTAMP.

Prototype

TemporalType TIMESTAMP

To view the source code for javax.persistence TemporalType TIMESTAMP.

Click Source Link

Document

Map as java.sql.Timestamp

Usage

From source file:org.photovault.common.DbInfo.java

/**
 Get the time when this database was created.
 *//* w w  w.  j  av a 2 s  .c om*/
@Column(name = "create_time")
@Temporal(value = TemporalType.TIMESTAMP)
public Date getCreateTime() {
    return createTime != null ? (Date) createTime.clone() : null;
}

From source file:org.photovault.imginfo.FileLocation.java

@Column(name = "last_checked")
@Temporal(value = TemporalType.TIMESTAMP)
public Date getLastChecked() {
    return lastChecked;
}

From source file:org.photovault.imginfo.PhotoInfo.java

/**
 * Get the value of shootTime. Note that shoot time can also be
 null (to mean that the time is unspecified)1
 @return value of shootTime.//from   w  w w .j a v  a 2s.c om
 */
@Column(name = "shoot_time")
@Temporal(value = TemporalType.TIMESTAMP)
public java.util.Date getShootTime() {
    return shootTime != null ? (java.util.Date) shootTime.clone() : null;
}

From source file:org.photovault.imginfo.PhotoInfo.java

/**
 Returns the time when this photo (=metadata of it) was last modified
 * @return a <code>Date</code> value
 *//*  w w  w  .ja  v a 2 s  . c o m*/
@ValueField
@Column(name = "last_modified")
@Temporal(value = TemporalType.TIMESTAMP)
public java.util.Date getLastModified() {
    return lastModified != null ? (java.util.Date) lastModified.clone() : null;
}

From source file:org.silverpeas.core.notification.user.delayed.repository.DelayedNotificationDataJpaRepository.java

@Override
public List<DelayedNotificationData> findDelayedNotification(
        final DelayedNotificationData delayedNotification) {

    // Parameters
    NamedParameters namedParameters = newNamedParameters();

    // Query/* w  ww  .j  av  a  2  s.com*/
    final StringBuilder query = new StringBuilder("from DelayedNotificationData where");
    query.append(" userId = :");
    query.append(namedParameters.add("userId", delayedNotification.getUserId()).getLastParameterName());
    query.append(" and fromUserId = :");
    query.append(namedParameters.add("fromUserId", delayedNotification.getFromUserId()).getLastParameterName());
    query.append(" and channel = :");
    query.append(
            namedParameters.add("channel", delayedNotification.getChannel().getId()).getLastParameterName());
    query.append(" and action = :");
    query.append(namedParameters.add("action", delayedNotification.getAction().getId()).getLastParameterName());
    query.append(" and language = :");
    query.append(namedParameters.add("language", delayedNotification.getLanguage()).getLastParameterName());
    Date date = delayedNotification.getCreationDate();
    if (date == null) {
        date = new Date();
    }
    query.append(" and creationDate between :");
    query.append(namedParameters.add("creationDateMin", addSeconds(date, -45), TemporalType.TIMESTAMP)
            .getLastParameterName());
    query.append(" and :");
    query.append(namedParameters.add("creationDateMax", addSeconds(date, 45), TemporalType.TIMESTAMP)
            .getLastParameterName());
    query.append(" and notificationResourceId = :");
    query.append(namedParameters.add("resourceId", delayedNotification.getResource()).getLastParameterName());

    // resourceDescription parameter
    if (StringUtils.isNotBlank(delayedNotification.getMessage())) {
        query.append(" and message = :");
        query.append(namedParameters.add("message", delayedNotification.getMessage()).getLastParameterName());
    } else {
        query.append(" and message is null");
    }

    // Result
    return listFromJpqlString(query.toString(), namedParameters, DelayedNotificationData.class);
}

From source file:org.zanata.model.ModelEntityBase.java

@Temporal(TemporalType.TIMESTAMP)
@Column(nullable = false)
public Date getCreationDate() {
    return creationDate != null ? new Date(creationDate.getTime()) : null;
}

From source file:org.zanata.model.ModelEntityBase.java

@Temporal(TemporalType.TIMESTAMP)
@Column(nullable = false)//  w w w  . j  av  a  2  s  .c o m
@Field(analyze = Analyze.NO)
@FieldBridge(impl = DateBridge.class)
@SortableField
public Date getLastChanged() {
    return lastChanged != null ? new Date(lastChanged.getTime()) : null;
}

From source file:pl.umk.mat.zawodyweb.database.pojo.Users.java

/**
 * @return birthTimestamp/* w w  w  .j a  v a2 s . c o m*/
 */
@Basic(fetch = FetchType.LAZY)
@Column(name = "birthdate")
@Temporal(TemporalType.TIMESTAMP)
public Date getBirthdate() {
    return birthdate;
}

From source file:ru.anr.base.domain.BaseEntity.java

/**
 * @return the created/*from   w  w w  . j  av  a2 s  .c  o  m*/
 */
@Column(name = "i_created")
@Temporal(TemporalType.TIMESTAMP)
public Calendar getCreated() {

    return cloneObject(created);
}

From source file:ua.its.slot7.caccounting.model.person.Person.java

/**
 * Last update
 */
@Column
@Temporal(TemporalType.TIMESTAMP)
public Date getLastUpdate() {
    return lastUpdate;
}