List of usage examples for javax.persistence TemporalType TIMESTAMP
TemporalType TIMESTAMP
To view the source code for javax.persistence TemporalType TIMESTAMP.
Click Source Link
java.sql.Timestamp
From source file:gov.nih.nci.cabig.caaers.domain.SiteResearchStaff.java
/** * Gets the start date./* w w w . j av a 2s. c om*/ * * @return the start date */ @Temporal(TemporalType.TIMESTAMP) @Column(name = "start_date") public Date getStartDate() { return startDate; }
From source file:com.zl.bgec.basicapi.shop.po.Shop.java
@Temporal(TemporalType.TIMESTAMP) @Column(name = "license_End_Time") public Date getLicenseEndTime() { return licenseEndTime; }
From source file:org.opennms.netmgt.model.OnmsNotification.java
/** * <p>getRespondTime</p>// w w w. j a v a 2s . c o m * * @return a {@link java.util.Date} object. */ @XmlElement(name = "respondTime") @Temporal(TemporalType.TIMESTAMP) @Column(name = "respondTime") public Date getRespondTime() { return m_respondTime; }
From source file:gov.nih.nci.cabig.caaers.domain.report.ReportVersion.java
/** * Gets the due on. * * @return the due on */ @Temporal(value = TemporalType.TIMESTAMP) public Date getDueOn() { return dueOn; }
From source file:gov.nih.nci.cabig.caaers.domain.SiteResearchStaff.java
/** * Gets the end date.//from w ww. j a v a 2s . co m * * @return the end date */ @Temporal(TemporalType.TIMESTAMP) @Column(name = "end_date") public Date getEndDate() { return endDate; }
From source file:gov.nih.nci.cabig.caaers.domain.report.ReportVersion.java
/** * Gets the amended on. * * @return the amended on */ @Temporal(value = TemporalType.TIMESTAMP) public Date getAmendedOn() { return amendedOn; }
From source file:com.busimu.core.dao.impl.UserMngDaoPolicyJpaImpl.java
/** * {@inheritDoc}//from w w w. j a v a 2 s . c o m */ @Override public List<LoginHistory> getRealLoginHistory(User user, Campaign campaign) { EntityManager em = ((EntityManagerHolder) TransactionSynchronizationManager.getResource(emf)) .getEntityManager(); Date startDate = new Date(Long.parseLong(campaign.getMeta(MetaKey.CAMPAIGN_START_TIME))); List<Round> rounds = campaign.getSortedRoundsAsList(); Date endDate = rounds.get(rounds.size() - 1).getEndDate(); TypedQuery<LoginHistory> q = em.createQuery( "select lh from LoginHistory lh where lh.user = :user and lh.loginDate between :start and :end", LoginHistory.class); q.setParameter("user", user); q.setParameter("start", startDate, TemporalType.TIMESTAMP); q.setParameter("end", endDate, TemporalType.TIMESTAMP); return q.getResultList(); }
From source file:com.fiveamsolutions.nci.commons.audit.AuditLogRecord.java
/** * @return create date */ @Temporal(TemporalType.TIMESTAMP) @NotNull public Date getCreatedDate() { return this.createdDate; }
From source file:com.p5solutions.core.jpa.orm.ConversionUtilityImpl.java
/** * Convert timestamp./*from ww w . jav a 2s .c o m*/ * * @param pb * the pb * @param timestamp * the timestamp * @param targetType * the target type * @return the object */ public Object convertTimestamp(ParameterBinder pb, Timestamp timestamp, Class<?> targetType) { // TODO probably needs further checking based on JPA annotations, some // timezone issues??? if (ReflectionUtility.isDate(targetType)) { // Check for Temporal if (pb != null) { Temporal temporal = pb.getTemporal(); if (temporal != null) { Date converted = timestamp; if (TemporalType.DATE.equals(temporal.value())) { java.sql.Date dt = new java.sql.Date(timestamp.getTime()); return dt; } else if (TemporalType.TIME.equals(temporal.value())) { java.sql.Time tm = new java.sql.Time(timestamp.getTime()); return tm; } else if (TemporalType.TIMESTAMP.equals(temporal.value())) { } return converted; } } Date test = new Date(timestamp.getTime()); return test; // return (Date) timestamp; } else if (ReflectionUtility.isStringClass(targetType)) { // TODO needs to be formatted based on the Format defined by the // 'custom?' // Format annotation ???? return timestamp.toLocaleString(); } else if (ReflectionUtility.isLongClass(targetType)) { } return timestamp; }
From source file:com.netxforge.oss2.model.OnmsIpRouteInterface.java
@Temporal(TemporalType.TIMESTAMP) @Column(nullable = false) @XmlElement public Date getLastPollTime() { return m_lastPollTime; }