Package javax.persistence

Examples of javax.persistence.TemporalType


        serializeColumns(field.getValueInfo(), ColType.COL,
            field.getMappingInfo().getTableName(), null, fmd);
        if (strategy == PersistenceStrategy.BASIC && isLob(field)) {
            addAnnotation(Lob.class, fmd);
        }
        TemporalType temporal = getTemporal(field);
        if (temporal != null) {
            addAnnotation(Temporal.class, fmd).
                add(null, temporal);
        }
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<Column> cols = fm.getKeyMapping().getValueInfo().getColumns();
        if (cols.isEmpty()) {
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<Column> cols = fm.getKeyMapping().getValueInfo().getColumns();
        if (cols.isEmpty()) {
View Full Code Here

        serializeColumns(field.getValueInfo(), ColType.COL,
            field.getMappingInfo().getTableName(), null, fmd);
        if (strategy == PersistenceStrategy.BASIC && isLob(field)) {
            addAnnotation(Lob.class, fmd);
        }
        TemporalType temporal = getTemporal(field);
        if (temporal != null) {
            addAnnotation(Temporal.class, fmd).
                add(null, temporal);
        }
View Full Code Here

            field.getMappingInfo().getTableName());
        if (strategy == PersistenceStrategy.BASIC && isLob(field)) {
            startElement("lob");
            endElement("lob");
        }
        TemporalType temporal = getTemporal(field);
        if (temporal != null) {
            startElement("temporal");
            addText(temporal.toString());
            endElement("temporal");
        }

        EnumType enumType = getEnumType(field);
        if (enumType != null && enumType != EnumType.ORDINAL) {
View Full Code Here

        void onAttribute(
                JpaAttribute attribute,
                AnnotatedElement element,
                AnnotationProcessorStack context) {

            TemporalType value = element.getAnnotation(Temporal.class).value();

            if (attribute instanceof JpaBasic) {
                ((JpaBasic) attribute).setTemporal(value);
            }
            // according to the spec, only @Basic is compatibel with @Temporal, however
View Full Code Here

        void onAttribute(
                JpaAttribute attribute,
                AnnotatedElement element,
                AnnotationProcessorStack context) {

            TemporalType value = element.getAnnotation(Temporal.class).value();

            if (attribute instanceof JpaBasic) {
                ((JpaBasic) attribute).setTemporal(value);
            }
            // according to the spec, only @Basic is compatibel with @Temporal, however
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

   */
  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

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.