Internal Website Search

1-50 of 57 results

JPA Persistable Types

date1; @Temporal ( TemporalType . DATE ) java.util.Date date2 @Temporal ( TemporalType . DATE ) java.util.Calendar date3; // Time Only: java.sql.Time time1; @Temporal ( TemporalType . TIME ) java.util.Date time2; @Temporal ( TemporalType . TIME ) java.util.Calendar time3; // Date and Time: java.sql

Query Parameters in JPA

. setParameter ("date", new java.util.Date(), TemporalType . DATE ); Since TemporalType . Date represents

javax.persistence.TemporalType

JPA Enum TemporalType java.lang.Object ∟  java.lang.Enum ∟  javax.persistence. TemporalType Type used to indicate a specific mapping of java.util.Date or java.util.Calendar . Since: JPA 1.0 The JPA Persistable Types article explains how to use TemporalType . Enum Constants DATE Map as

Query.setParameter(name,value,temporalType) - JPA Method

JPA Method in javax.persistence.Query Query setParameter (   String name,    Calendar value,     TemporalType   temporalType ) Bind an instance ... value temporalType - temporal type Return: the same query instance Throws: IllegalArgumentException

Query.setParameter(param,value,temporalType) - JPA Method

JPA Method in javax.persistence.Query Query setParameter (    Parameter  param,    Date value,     TemporalType   temporalType ) Bind ... value temporalType - temporal type Return: the same query instance Throws: IllegalArgumentException

Query.setParameter(param,value,temporalType) - JPA Method

JPA Method in javax.persistence.Query Query setParameter (    Parameter  param,    Calendar value,     TemporalType   temporalType ) Bind ... - parameter value temporalType - temporal type Return: the same query instance Throws

Query.setParameter(position,value,temporalType) - JPA Method

JPA Method in javax.persistence.Query Query setParameter (   int position,    Date value,     TemporalType   temporalType ) Bind an instance ... temporalType - temporal type Return: the same query instance Throws: IllegalArgumentException

Query.setParameter(position,value,temporalType) - JPA Method

JPA Method in javax.persistence.Query Query setParameter (   int position,    Calendar value,     TemporalType   temporalType ) Bind an instance ... value temporalType - temporal type Return: the same query instance Throws: IllegalArgumentException

Query.setParameter(name,value,temporalType) - JPA Method

JPA Method in javax.persistence.Query Query setParameter (   String name,    Date value,     TemporalType   temporalType ) Bind an instance ... temporalType - temporal type Return: the same query instance Throws: IllegalArgumentException

TypedQuery.setParameter(param,value,temporalType) - JPA Method

JPA Method in javax.persistence.TypedQuery TypedQuery setParameter (    Parameter  param,    Date value,     TemporalType   temporalType ) Bind ... - parameter value temporalType - temporal type Return: the same query instance Throws

TypedQuery.setParameter(param,value,temporalType) - JPA Method

JPA Method in javax.persistence.TypedQuery TypedQuery setParameter (    Parameter  param,    Calendar value,     TemporalType   temporalType ... value - parameter value temporalType - temporal type Return: the same query instance Throws

StoredProcedureQuery.setParameter(position,value,temporalType) - JPA Method

; int position,    Calendar value,     TemporalType   temporalType ) Bind an instance of java.util.Calendar to a positional parameter. Parameters: position - position value - parameter value temporalType - temporal type Return: the same query instance

StoredProcedureQuery.setParameter(name,value,temporalType) - JPA Method

; String name,    Date value,     TemporalType   temporalType ) Bind an instance of java.util.Date to a named parameter. Parameters: name - parameter name value - parameter value temporalType - temporal type Return: the same query instance Throws

StoredProcedureQuery.setParameter(name,value,temporalType) - JPA Method

; String name,    Calendar value,     TemporalType   temporalType ) Bind an instance of java.util.Calendar to a named parameter. Parameters: name - parameter name value - parameter value temporalType - temporal type Return: the same query instance Throws

StoredProcedureQuery.setParameter(position,value,temporalType) - JPA Method

; int position,    Date value,     TemporalType   temporalType ) Bind an instance of java.util.Date to a positional parameter. Parameters: position - position value - parameter value temporalType - temporal type Return: the same query instance Throws

StoredProcedureQuery.setParameter(param,value,temporalType) - JPA Method

;  Parameter  param,    Date value,     TemporalType   temporalType ) Bind an instance of java.util.Date to a Parameter object. Parameters: param - parameter object value - parameter value temporalType - temporal type Return: the same query instance

StoredProcedureQuery.setParameter(param,value,temporalType) - JPA Method

;  Parameter  param,    Calendar value,     TemporalType   temporalType ) Bind an instance of java.util.Calendar to a Parameter object. Parameters: param - parameter object value - parameter value temporalType - temporal type Return: the same query

TypedQuery.setParameter(position,value,temporalType) - JPA Method

JPA Method in javax.persistence.TypedQuery TypedQuery setParameter (   int position,    Calendar value,     TemporalType   temporalType ) Bind ... - parameter value temporalType - temporal type Return: the same query instance Throws

TypedQuery.setParameter(position,value,temporalType) - JPA Method

JPA Method in javax.persistence.TypedQuery TypedQuery setParameter (   int position,    Date value,     TemporalType   temporalType ) Bind ... - parameter value temporalType - temporal type Return: the same query instance Throws

TypedQuery.setParameter(name,value,temporalType) - JPA Method

JPA Method in javax.persistence.TypedQuery TypedQuery setParameter (   String name,    Date value,     TemporalType   temporalType ) Bind ... value temporalType - temporal type Return: the same query instance Throws: IllegalArgumentException

TypedQuery.setParameter(name,value,temporalType) - JPA Method

JPA Method in javax.persistence.TypedQuery TypedQuery setParameter (   String name,    Calendar value,     TemporalType   temporalType ) Bind ... - parameter value temporalType - temporal type Return: the same query instance Throws

TemporalType injection with Calendar using JPA

an embedded object as a primary key, which has time fields which I have annotated with TemporalType ... ; private String periodType; @Temporal( TemporalType .TIMESTAMP) public Calendar getBeginTime() { return ... ( TemporalType .TIMESTAMP) public Calendar getEndTime() { return endTime; } public void setEndTime

javax.persistence.TemporalType.TIMESTAMP

JPA Enum Constant in javax.persistence. TemporalType TIMESTAMP Map as java.sql.Timestamp Since: JPA 1.0

javax.persistence.TemporalType.TIME

JPA Enum Constant in javax.persistence. TemporalType TIME Map as java.sql.Time Since: JPA 1.0

javax.persistence.TemporalType.DATE

JPA Enum Constant in javax.persistence. TemporalType DATE Map as java.sql.Date Since: JPA 1.0

Internal exception when updating date filed (TemporalType.DATE)

Hello! ObjectDB version 2.5.3_02. I get internal exception when commiting update Date field (javax.persistence. TemporalType .DATE). [ObjectDB 2.5.3_02] javax.persistence.RollbackException Failed to commit transaction: (error 613) at com.objectdb.jpa.EMImpl.commit(EMImpl.java:290

javax.persistence.Query

;value,  TemporalType   temporalType ) Bind an instance of java.util.Calendar to a Parameter object. Parameters: param - parameter object value - parameter value temporalType - temporal type Return ... ;value,  TemporalType   temporalType ) Bind an instance of java.util.Date to a Parameter

javax.persistence.TypedQuery

,  TemporalType   temporalType ) Bind an instance of java.util.Calendar to a Parameter object. Parameters: param - parameter object value - parameter value temporalType - temporal type Return ...  value,  TemporalType   temporalType ) Bind an instance of java.util.Date to a Parameter

javax.persistence.StoredProcedureQuery

; TemporalType   temporalType ) Bind an instance of java.util.Calendar to a Parameter object. Parameters: param - parameter object value - parameter value temporalType - temporal type Return: the same query ... ,  TemporalType   temporalType ) Bind an instance of java.util.Date to a Parameter object

General Performance Issues Illustrated with a Specific Method

createdBy; @Temporal(javax.persistence. TemporalType .TIMESTAMP) private Date createdAt; @Temporal(javax.persistence. TemporalType .DATE) private Date createdOn; @ManyToOne(fetch = FetchType.LAZY) private ... (javax.persistence. TemporalType .TIMESTAMP) private Date lastEditeAt; /* Retire Reversal Properties

query on calendar class

; @Temporal( TemporalType .TIMESTAMP) private Calendar start; I tested: Query query=em.createQuery ... .Timestamp, java.util.Date with @Temporal( TemporalType .DATE), @Temporal( TemporalType .TIME) and @Temporal( TemporalType .TIMESTAMP). I test the queries: Query query=em.createQuery("SELECT c FROM Cdr c

Date field Index is corrupted due to time change

.persistence. TemporalType ; import javax.persistence.Version; public class DeleteTest {    ... ; @Basic(optional = false)         @Temporal( TemporalType .TIMESTAMP ... ; @Basic(optional = false)         @Temporal( TemporalType .DATE)  

Query filter comparing Dates

the database as time (e.g. in milliseconds) since 1.1.1970 UTC. For  TemporalType .DATE the hours ... removed the          @Temporal( TemporalType .DATE)  annotation ... . So it seems to me that the         @Temporal( TemporalType .DATE) annotation

Finding an object by its datetime

", btime, TemporalType .TIMESTAMP); } @Entity public class Booking { @Temporal( TemporalType .TIMESTAMP ... Support Hi, I forgot the @Index beside @Temporal( TemporalType .TIMESTAMP) Calendar btime; It looks like this now in the entity class: @Index @Temporal( TemporalType .TIMESTAMP) Calendar btime; And I

Wrong data stored in time only fields

.persistence.Temporal; import javax.persistence. TemporalType ; import javax.persistence.Version; public ... ;  @Temporal( TemporalType .TIMESTAMP)         public Date ... ;  @Temporal( TemporalType .DATE)         public Date getStartDate

Wrong data stored in date only fileds

( TemporalType .TIMESTAMP) public Date getStartDateTime() { return startDateTime; } public void ... ( TemporalType .DATE) public Date getStartDate() { return startDate; } public void setStartDate(Date startDate) { this.startDate = startDate; } @Basic(optional = false) @Temporal( TemporalType .TIME) public

Error 363 - Failed to read value of inverse relationship

( TemporalType .TIMESTAMP) private Date signUpDate = new Date(), signInDate; @Embedded @OneToOne private ... @GeneratedValue private Long id; @Temporal( TemporalType .TIMESTAMP) private Date sendDate = new Date ... ; @GeneratedValue //    private Long id; // //    @Temporal( TemporalType

Possible issue with String fields

.persistence. TemporalType .DATE) Date start_dt; @Temporal(javax.persistence. TemporalType .DATE) Date end_dt; @Temporal(javax.persistence. TemporalType .DATE) Date new_end_dt; String vehicle_group; String vehicle

LifeCycle Event with Embeddable classes

= FetchType.EAGER) private List barList; @Temporal( TemporalType .TIMESTAMP) private Timestamp ... ()); }} @Embeddable public class Bar { @Temporal( TemporalType .TIMESTAMP) private Timestamp modifyDate

Order in WHERE Clause affects behaviour on DATE/DATETIME columns

Quick example:  public class MyClass { @Column(name = "myText") String myText; @Temporal( TemporalType .TIMESTAMP) @Column(name = "myDate") Date myDate; } Now, when querying the db with: Query q ... the query parameter as TemporalType .TIMESTAMP . But when I write following query: Query q = JPA.em

Calendar in Criteria Querys

;            @Temporal( TemporalType .TIMESTAMP ... ;       @Temporal( TemporalType .TIMESTAMP)     

java.sql.Timestamp.getTime() not working

Player { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) public int id; @Temporal( TemporalType .TIMESTAMP) public Timestamp loginAt; @Temporal( TemporalType .TIMESTAMP) public Timestamp registeredAt

How to use JOIN FETCH?

.persistence. TemporalType ; import javax.persistence.TypedQuery; public class Eager2 { public static void main ... ; @OneToMany   @MapKeyTemporal( TemporalType .DATE)   private Map addressHistory = new HashMap

Problem with entities detection

.persistence. TemporalType ; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind ... _nacimiento") @Temporal( TemporalType .DATE) private Date fecha_nacimiento; private int[] telefonos

javax.persistence.Temporal.value

JPA Annotation Attribute in javax.persistence.Temporal TemporalType value default null The type used in mapping java.util.Date or java.util.Calendar . Since: JPA 1.0

javax.persistence.Temporal

. Public Annotation Attributes TemporalType value default null The type used in mapping java.util.Date or java.util.Calendar . Since: JPA 1.0

javax.persistence.MapKeyTemporal.value

JPA Annotation Attribute in javax.persistence.MapKeyTemporal TemporalType value default null (Required) The type used in mapping java.util.Date or java.util.Calendar . Since: JPA 2.0

javax.persistence.MapKeyTemporal

.Map employees; Since: JPA 2.0 Public Annotation Attributes TemporalType value default null

_PersistenceException: Type is not found on getSingleResult.

;  @Temporal( TemporalType .DATE)     private Date fechaNacimiento;    

com.objectdb.o.InternalException: java.lang.ArrayIndexOutOfBoundsException: null

;  String url = "";     @Temporal(javax.persistence. TemporalType .TIMESTAMP)     private Date createdTime;     @Temporal(javax.persistence. TemporalType ... ;  @Temporal(javax.persistence. TemporalType .TIMESTAMP)     Date postTime;