Package javax.persistence

Examples of javax.persistence.TemporalType


   */
  private void getMapKeyTemporal(List<Annotation> annotationList, Element element) {
    Element subelement = element != null ? element.element( "map-key-temporal" ) : null;
    if ( subelement != null ) {
      AnnotationDescriptor ad = new AnnotationDescriptor( MapKeyTemporal.class );
      TemporalType value = TemporalType.valueOf( subelement.getTextTrim() );
      ad.setValue( "value", value );
      annotationList.add( AnnotationFactory.create( ad ) );
    }
  }
View Full Code Here


        throw new AnnotationException(
            "@Temporal should only be set on a java.util.Date or java.util.Calendar property: "
                + StringHelper.qualify( persistentClassName, propertyName )
        );
      }
      final TemporalType temporalType = getTemporalType( property );
      switch ( temporalType ) {
        case DATE:
          type = isDate ? "date" : "calendar_date";
          break;
        case TIME:
View Full Code Here

        throw new AnnotationException(
            "@Temporal should only be set on a java.util.Date or java.util.Calendar property: "
                + StringHelper.qualify( persistentClassName, propertyName )
        );
      }
      final TemporalType temporalType = getTemporalType( property );
      switch ( temporalType ) {
        case DATE:
          type = isDate ? "date" : "calendar_date";
          break;
        case TIME:
View Full Code Here

    /**
     * Parse temporal.
     */
    private void endMapKeyTemporal() {
        String temp = currentText();
        TemporalType _mapKeyTemporal = null;
        if (!StringUtils.isEmpty(temp))
            _mapKeyTemporal = Enum.valueOf(TemporalType.class, temp);
        FieldMapping fm = (FieldMapping) currentElement();
        List cols = fm.getKeyMapping().getValueInfo().getColumns();
        if (cols.isEmpty()) {
View Full Code Here

        throw new AnnotationException(
            "@Temporal should only be set on a java.util.Date or java.util.Calendar property: "
                + StringHelper.qualify( persistentClassName, propertyName )
        );
      }
      final TemporalType temporalType = getTemporalType( property );
      switch ( temporalType ) {
        case DATE:
          type = isDate ? "date" : "calendar_date";
          break;
        case TIME:
View Full Code Here

   */
  private void getMapKeyTemporal(List<Annotation> annotationList, Element element) {
    Element subelement = element != null ? element.element( "map-key-temporal" ) : null;
    if ( subelement != null ) {
      AnnotationDescriptor ad = new AnnotationDescriptor( MapKeyTemporal.class );
      TemporalType value = TemporalType.valueOf( subelement.getTextTrim() );
      ad.setValue( "value", value );
      annotationList.add( AnnotationFactory.create( ad ) );
    }
  }
View Full Code Here

                    EnumType type = (EnumType)annotationValues.get("value");
                    jdbcType = (type == EnumType.STRING ? "VARCHAR" : "INTEGER");
                }
                else if (JPAAnnotationUtils.isTemporalType(field.getType()) && annName.equals(JPAAnnotationUtils.TEMPORAL))
                {
                    TemporalType type = (TemporalType)annotationValues.get("value");
                    if (type == TemporalType.DATE)
                    {
                        jdbcType = "DATE";
                    }
                    else if (type == TemporalType.TIME)
View Full Code Here

TOP

Related Classes of javax.persistence.TemporalType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.