Example usage for javax.persistence TemporalType DATE

List of usage examples for javax.persistence TemporalType DATE

Introduction

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

Prototype

TemporalType DATE

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

Click Source Link

Document

Map as java.sql.Date

Usage

From source file:com.taobao.ad.easyschedule.dao.logs.impl.JPALogsDAOImpl.java

@Override
public Long getCountByTypeAndTime(final Long opsubtype, final Date startTime, final Date endTime) {
    return (Long) super.getJpaTemplate().execute(new JpaCallback() {
        @Override//ww w  . ja v  a2  s  . c om
        public Object doInJpa(EntityManager em) throws PersistenceException {
            return em.createQuery(
                    "select count(*) from es_logs t where  t.optime<=?1 and t.optime >=?2 and t.opsubtype=?3")
                    .setParameter(1, endTime, TemporalType.DATE).setParameter(2, startTime, TemporalType.DATE)
                    .setParameter(3, opsubtype).getSingleResult();

        }
    });

}

From source file:com.home.ln_spring.ch10.domain.ContactAudit.java

@Temporal(TemporalType.DATE)
@Column(name = "BIRTH_DATE")
public Date getBirthDate() {
    return birthDate;
}

From source file:com.lcw.one.common.persistence.DataEntity.java

@Temporal(TemporalType.DATE)
@Transient
public Date getCreateDateStart() {
    return DateUtils.getDateStart(createDateStart);
}

From source file:com.lcw.one.common.persistence.DataEntity.java

@Temporal(TemporalType.DATE)
@Transient
public Date getCreateDateEnd() {
    return DateUtils.getDateEnd(createDateEnd);
}

From source file:org.batoo.jpa.core.impl.model.attribute.BasicAttribute.java

/**
 * Constructor for version attributes.//from   w w  w . j av a  2s  . c o  m
 * 
 * @param declaringType
 *            the declaring type
 * @param metadata
 *            the metadata
 * 
 * @since 2.0.0
 */
public BasicAttribute(IdentifiableTypeImpl<X> declaringType, VersionAttributeMetadata metadata) {
    super(declaringType, metadata);

    this.version = true;
    this.optional = false;
    this.idType = null;
    this.generator = null;
    this.lob = false;
    this.enumType = null;
    this.index = null;
    this.columnTransformer = null;

    this.type = this.getDeclaringType().getMetamodel().createBasicType(this.getJavaType());

    if (this.getJavaType() == Timestamp.class) {
        this.temporalType = TemporalType.TIMESTAMP;
    } else if (this.getJavaType() == java.sql.Date.class) {
        this.temporalType = TemporalType.DATE;
    } else if (this.getJavaType() == java.sql.Time.class) {
        this.temporalType = TemporalType.TIME;
    } else if ((this.getJavaType() == Date.class) || (this.getJavaType() == Calendar.class)) {
        this.temporalType = metadata.getTemporalType() != null ? metadata.getTemporalType()
                : TemporalType.TIMESTAMP;
    } else {
        this.temporalType = null;
    }
}

From source file:uk.ac.ebi.bioinvindex.model.Investigation.java

@Temporal(TemporalType.DATE)
public Date getSubmissionDate() {
    return submissionDate;
}

From source file:com.lcw.one.common.persistence.DataEntity.java

@Temporal(TemporalType.DATE)
@Transient
public Date getUpdateDateStart() {
    return DateUtils.getDateStart(updateDateStart);
}

From source file:uk.ac.ebi.bioinvindex.model.Investigation.java

@Temporal(TemporalType.DATE)
public Date getReleaseDate() {
    return releaseDate;
}

From source file:com.testing26thjuly_.db123testing.AllTypes.java

@Temporal(TemporalType.DATE)
@Column(name = "`DATE COL`", nullable = false)
public Date getDateCol() {
    return this.dateCol;
}

From source file:com.testing26thjuly_.db123testing.NewTypesUser.java

@Temporal(TemporalType.DATE)
@Column(name = "`Date Col`", nullable = true)
public Date getDateCol() {
    return this.dateCol;
}