Changeset 7643


Ignore:
Timestamp:
Mar 12, 2019, 8:29:06 AM (3 years ago)
Author:
Nicklas Nordborg
Message:

References #2137: Remove some of the deprecated code

Removed things that are more likely to be used in extensions. It is mainly API methods associated with accessing annotations and building queries with annotations. Most of the deprecated methods were related to the implementation of cloned annotations in #1941.

Location:
trunk/src
Files:
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/core/Annotation.java

    r7610 r7643  
    650650  }
    651651
    652   @Deprecated
    653   public void setValue(Object value)
    654     throws PermissionDeniedException, InvalidDataException, BaseException
    655   {
    656     setValueIfDifferent(value, null);
    657   }
    658  
    659   /**
    660     Set the value of the annotation, replacing any previous values.
    661     @param value The new value
    662     @param unit The unit of the value, or null to use the default unit of
    663       the annotation type
    664     @throws PermissionDeniedException If the logged in user doesn't have
    665       write permission for the annotation or read permission for the annotation
    666       type
    667     @throws InvalidDataException If the value isn't a valid value for the
    668       annotation type, see {@link AnnotationType#validateAnnotationValue(Object)}
    669     @throws BaseException If there is another error
    670     @since 2.9
    671     @deprecated In 3.8, use {@link #setValueIfDifferent(Object, Unit)} instead
    672   */
    673   @Deprecated
    674   public void setValue(Object value, Unit unit)
    675     throws PermissionDeniedException, InvalidDataException, BaseException
    676   {
    677     setValueIfDifferent(value, unit);
    678   }
    679 
    680652  /**
    681653    Set the value of the annotation, replacing any previous values if they
     
    707679  {
    708680    return setValuesIfDifferent(Arrays.asList(value), unit);
    709   }
    710 
    711  
    712   @Deprecated
    713   public void setValues(List<?> values)
    714     throws PermissionDeniedException, InvalidDataException, BaseException
    715   {
    716     setValuesIfDifferent(values, null);
    717   }
    718  
    719   /**
    720     Set the values of the annotation, replacing any previous values. NOTE!
    721     As of BASE 3.8 the values are only replaced if the new values are
    722     different from the existing values.
    723    
    724     @deprecated In 3.8, use {@link #setValuesIfDifferent(List, Unit)} instead
    725   */
    726   @Deprecated
    727   public void setValues(List<?> values, Unit unit)
    728     throws PermissionDeniedException, InvalidDataException, BaseException
    729   {
    730     setValuesIfDifferent(values, unit);
    731681  }
    732682
  • trunk/src/core/net/sf/basedb/core/AnnotationBetweenRestriction.java

    r7461 r7643  
    4444  private final Object highValue;
    4545
    46   /**
    47     @since 2.4
    48     @deprecated In 3.5; Use {@link #AnnotationBetweenRestriction(String, AnnotationType, Object, Object, boolean, boolean)} instead
    49   */
    50   @Deprecated
    51   public AnnotationBetweenRestriction(String alias, AnnotationType annotationType, Object lowValue, Object highValue, boolean includeInherited)
    52     throws InvalidDataException
    53   {
    54     this(alias, annotationType, lowValue, highValue, new Options().setIncludeInherited(includeInherited));
    55   }
    5646
    57 
    58   /**
    59     @since 3.0
    60     @deprecated In 3.5; Use {@link #AnnotationBetweenRestriction(String, int, Type, Object, Object, boolean, boolean)} instead
    61   */
    62   @Deprecated
    63   public AnnotationBetweenRestriction(String alias, int annotationTypeId, Type valueType, Object lowValue, Object highValue,
    64     boolean includeInheriting)
    65     throws InvalidDataException
    66   {
    67     this(alias, annotationTypeId, valueType, lowValue, highValue, true, includeInheriting);
    68   }
    6947
    7048  /**
  • trunk/src/core/net/sf/basedb/core/AnnotationInRestriction.java

    r7461 r7643  
    4545  private final List<?> values;
    4646
    47   /**
    48     @since 2.4
    49     @deprecated In 3.5; use {@link #AnnotationInRestriction(String, AnnotationType, boolean, boolean, Object...)} instead
    50   */
    51   @Deprecated
    52   public AnnotationInRestriction(String alias, AnnotationType annotationType, boolean includeInheriting, Object... values)
    53     throws InvalidDataException
    54   {
    55     this(alias, annotationType, true, includeInheriting, values);
    56   }
    5747 
    5848  /**
  • trunk/src/core/net/sf/basedb/core/AnnotationRestriction.java

    r7461 r7643  
    9595    @param annotationTypeId The id of the annotation type
    9696    @param valueType The type of values for annotations
     97    @deprecated In 3.11
    9798  */
    9899  @Deprecated
  • trunk/src/core/net/sf/basedb/core/AnnotationSet.java

    r7610 r7643  
    672672  }
    673673 
    674  
    675   /**
    676     Check if the annotation set contains primary annotation of the specified type.
    677    
    678     @param annotationType An <code>AnnotationType</code> object
    679     @return TRUE if the annotation set contains an annotation of
    680       the specified type, FALSE otherwise
    681     @deprecated In 3.6, use {@link #hasAnnotation(AnnotationType, net.sf.basedb.core.Annotation.Source)} instead
    682   */
    683   @Deprecated
    684   public boolean hasAnnotation(AnnotationType annotationType)
    685   {
    686     return hasAnnotation(annotationType, Annotation.Source.PRIMARY);
    687   }
    688  
    689674  /**
    690675    Check if the annotation set contains an annotation of the specified type.
     
    894879  }
    895880
    896  
    897   /**
    898     Get a query that returns all PRIMARY annotations in this annotation set.
    899 
    900     @return An <code>ItemQuery</code> object
    901     @deprecated In 3.6, use {@link #getAnnotations(net.sf.basedb.core.Annotation.Source)} instead
    902   */
    903   @Deprecated
    904   public ItemQuery<Annotation> getAnnotations()
    905   {
    906     return getAnnotations(Annotation.Source.PRIMARY);
    907   }
    908 
    909   /**
    910     Inherit an annotation.
    911     @param annotation The annotation to inherit which must be a primary
    912       annotation
    913     @throws PermissionDeniedException If the logged in user
    914       doesn't have write permission for this annotation set or
    915       use permission for the annotation or if the annotation type is not
    916       enabled for inheritance
    917     @throws InvalidDataException If the annotation is null
    918     @deprecated In 3.6, use {@link #inheritAnnotation(Annotation, boolean)} instead
    919   */
    920   @Deprecated
    921   public void inheritAnnotation(Annotation annotation)
    922     throws PermissionDeniedException, InvalidDataException
    923   {
    924     inheritAnnotation(annotation, false);
    925   }
    926  
    927881  /**
    928882    Inherit or clone an annotation. NOTE! If the annotation is already
     
    11301084    return removed;
    11311085  }
    1132  
    1133   /**
    1134     Inherit an annotation set. NOTE! Since BASE 3.6 the possibility to
    1135     inherit by annotation set is no longer supported. Calling
    1136     this method will be translated to inheriting all individual annotations
    1137     from the annotation set using {@link #inheritAll(AnnotationSet, boolean)}
    1138    
    1139     @param annotationSet The annotation set to inherit
    1140     @throws PermissionDeniedException If the logged in user
    1141       doesn't have write permission for this annotation set or
    1142       use permission for the annotation set to inherit
    1143     @throws InvalidDataException If the annotation set is null
    1144     @deprecated In 3.6, use {@link #inheritAll(AnnotationSet, boolean)} instead
    1145   */
    1146   @Deprecated
    1147   public void inheritAnnotationSet(AnnotationSet annotationSet)
    1148     throws PermissionDeniedException, InvalidDataException
    1149   {
    1150     inheritAll(annotationSet, false);
    1151   }
    1152  
    1153   /**
    1154     Remove an inherited an annotation set. NOTE! Since BASE 3.6 the possibility to
    1155     inherit by annotation set is no longer supported. Calling
    1156     this method will be translated to removing all individual annotations
    1157     from the annotation set using {@link #removeAllInherited(AnnotationSet)}.
    1158    
    1159     @param annotationSet The annotation set to remove
    1160     @throws PermissionDeniedException If the logged in user
    1161       doesn't have write permission for this annotation set
    1162     @throws InvalidDataException If the annotation set is null
    1163     @deprecated In 3.6, use {@link #removeAllInherited(AnnotationSet)} instead
    1164   */
    1165   @Deprecated
    1166   public void removeInheritedAnnotationSet(AnnotationSet annotationSet)
    1167     throws PermissionDeniedException, InvalidDataException
    1168   {
    1169     removeAllInherited(annotationSet);
    1170   }
    1171 
    1172   /**
    1173     Check if an annotation set is inherited or not by this annotation set.
    1174     NOTE! Since BASE 3.6 the possibility to inherit by annotation set is no
    1175     longer supported and this method will always return false.
    1176    
    1177     @param annotationSet The annotation set to check
    1178     @return Always false
    1179     @throws InvalidDataException If the annotation set is null
    1180     @deprecated In 3.6, no replacement
    1181   */
    1182   @Deprecated
    1183   public boolean isInherited(AnnotationSet annotationSet)
    1184     throws InvalidDataException
    1185   {
    1186     return false;
    1187   }
    1188 
    1189   /**
    1190     Get a query that returns all inherited annotation sets in this annotation set.
    1191     NOTE! Since BASE 3.6 the possibility to inherit by annotation set is no
    1192     longer supported and this method will always return a query that returns an empty
    1193     result.
    1194 
    1195     @return An <code>ItemQuery</code> object
    1196     @throws BaseException If there is an error
    1197     @deprecated In 3.6, no replacement
    1198   */
    1199   @Deprecated
    1200   public ItemQuery<AnnotationSet> getInheritedAnnotationSets()
    1201   {
    1202     ItemQuery<AnnotationSet> query = AnnotationSet.getQuery();
    1203     query.restrictPermanent(Restrictions.eq(Hql.property("id"), Expressions.integer(0)));
    1204     return query;
    1205   }
    12061086
    12071087  /**
     
    13711251  }
    13721252 
    1373  
    1374   /**
    1375     Get a query that returns all annotation sets inheriting from this annotation set.
    1376     NOTE! Since BASE 3.6 the possibility to inherit by annotation set is no
    1377     longer supported and this method will always return a query that returns an empty
    1378     result.
    1379     @return An <code>ItemQuery</code> object
    1380     @deprecated In 3.6, no replacement
    1381   */
    1382   @Deprecated
    1383   public ItemQuery<AnnotationSet> getInheritingAnnotationSets()
    1384   {
    1385     ItemQuery<AnnotationSet> query = AnnotationSet.getQuery();
    1386     query.restrictPermanent(Restrictions.eq(Hql.property("id"), Expressions.integer(0)));
    1387     return query;
    1388   }
    1389  
    13901253  /**
    13911254    Mark the snapshot (if it exists) of this annotation set as
  • trunk/src/core/net/sf/basedb/core/AnnotationSimpleRestriction.java

    r7494 r7643  
    5151  private List<ParameterExpression> parameters;
    5252
    53   /**
    54     @since 2.4
    55     @deprecated In 3.5; Use {@link #AnnotationSimpleRestriction(String, AnnotationType, Operator, Object, boolean, boolean)} instead
    56   */
    57   @Deprecated
    58   public AnnotationSimpleRestriction(String alias, AnnotationType annotationType, Operator operator, Object value, boolean includeInheriting)
    59     throws InvalidDataException
    60   {
    61     this(alias, annotationType, operator, value, true, includeInheriting);
    62   }
    63  
    6453  /**
    6554    @since 3.5
     
    152141    this.values = values;
    153142  }
    154 
    155  
    156   /**
    157     @since 2.4
    158     @deprecated in 3.5; Use {@link #AnnotationSimpleRestriction(String, int, Type, Operator, Object, boolean, boolean)} instead
    159   */
    160   @Deprecated
    161   public AnnotationSimpleRestriction(String alias, int annotationTypeId, Type valueType, Operator operator, Object value, boolean includeInheriting)
    162     throws InvalidDataException
    163   {
    164     this(alias, annotationTypeId, valueType, operator, value, true, includeInheriting);
    165   }
    166143 
    167144  /**
     
    190167    this.value = value;
    191168    this.values = null;
    192   }
    193  
    194   /**
    195     @since 2.5
    196     @deprecated In 3.5; Use {@link #AnnotationSimpleRestriction(String, int, Type, Operator, List, boolean, boolean)} instead
    197   */
    198   @Deprecated
    199   public AnnotationSimpleRestriction(String alias, int annotationTypeId, Type valueType, Operator operator, List<Object> values, boolean includeInheriting)
    200     throws InvalidDataException
    201   {
    202     this(alias, annotationTypeId, valueType, operator, values, true, includeInheriting);
    203169  }
    204170 
  • trunk/src/core/net/sf/basedb/core/Application.java

    r7572 r7643  
    959959 
    960960  /**
    961     Get an existing <code>SessionControl</code> object if you know
    962     the id.
    963    
    964     NOTE! For maximum backwards compatibility calling this method
    965     is equivalent to using "net.sf.basedb.clients.web" as the
    966     external client id and not checking if a user is logged in.
    967     Existing applications that use a different id MUST be updated to
    968     use the new method or they may no longer work in BASE 3.9.
    969  
    970     @deprecated In 3.9, use {@link #getSessionControl(String, String, String, boolean)} instead
    971   */
    972   @Deprecated
    973   public static SessionControl getSessionControl(String sessionControlId, String remoteId)
    974     throws ItemNotFoundException, BaseException
    975   {
    976     return getSessionControl(sessionControlId, "net.sf.basedb.clients.web", remoteId, false);
    977   }
    978  
    979   /**
    980961    Clean the cache from unused <code>SessionControl</code> objects.
    981962    @param force If TRUE all objects will be removed from the cache
  • trunk/src/core/net/sf/basedb/core/HasAnnotationRestriction.java

    r7461 r7643  
    4141
    4242  private boolean hasBeenAnnotatated;
    43  
    44   /**
    45     @deprecated In 3.5; Use {@link #HasAnnotationRestriction(String, AnnotationType, boolean, boolean, boolean)} instead
    46   */
    47   @Deprecated
    48   public HasAnnotationRestriction(String alias, AnnotationType annotationType,
    49     boolean hasBeenAnnotatated, boolean includeInheriting)
    50   {
    51     this(alias, annotationType.getId(), hasBeenAnnotatated, true, includeInheriting);
    52   }
    53  
    54   /**
    55     @deprecated In 3.5; Use {@link #HasAnnotationRestriction(String, int, boolean, boolean, boolean)} instead
    56   */
    57   @Deprecated
    58   public HasAnnotationRestriction(String alias, int annotationTypeId,
    59     boolean hasBeenAnnotatated, boolean includeInheriting)
    60   {
    61     this(alias, annotationTypeId, hasBeenAnnotatated, true, includeInheriting);
    62   }
    6343 
    6444  /**
  • trunk/src/core/net/sf/basedb/core/query/Annotations.java

    r6686 r7643  
    2525
    2626import net.sf.basedb.core.InvalidUseOfNullException;
    27 import net.sf.basedb.core.Operator;
    2827import net.sf.basedb.core.AnnotationType;
    29 import net.sf.basedb.core.AnnotationSimpleRestriction;
    30 import net.sf.basedb.core.AnnotationBetweenRestriction;
    31 import net.sf.basedb.core.AnnotationInRestriction;
    3228import net.sf.basedb.core.InvalidDataException;
    3329
     
    4036public class Annotations
    4137{
    42 
    43   /**
    44     Create a restriction that searches for annotations
    45     equal to a given value on the root or a joined entity of a
    46     query.
    47    
    48     @param alias The alias of the joined entity or null to use the root element
    49     @param annotationType The annotation type to search. Can not be null.
    50     @param value The value to search for. Can not be null.
    51     @param includeInheriting If items inheriting the annotation should be returned
    52       by the query or not
    53       @return A restriction on annotations.
    54     @throws InvalidDataException If annotationType or value are null.
    55     @since 2.4
    56     @deprecated In 3.5; Use{@link AnnotationSimpleRestriction} instead
    57   */
    58   @Deprecated
    59   public static Restriction eq(String alias, AnnotationType annotationType, Object value, boolean includeInheriting)
    60     throws InvalidDataException
    61   {
    62     return new AnnotationSimpleRestriction(alias, annotationType, Operator.EQ, value, includeInheriting);
    63   }
    64  
    65   /**
    66     Create a restriction that searches for annotations
    67     not equal to a given value on the root or a joined entity of a
    68     query.
    69  
    70     @param alias The alias of the joined entity or null to use the root element
    71     @param annotationType The annotation type to search. Can not be null.
    72     @param value The value to search for. Can not be null.
    73     @param includeInheriting If items inheriting the annotation should be returned
    74       by the query or not
    75     @return A restrictions to use for annotations.
    76     @throws InvalidDataException If annotationType or value are null.
    77     @since 2.4
    78     @deprecated In 3.5; Use{@link AnnotationSimpleRestriction} instead
    79   */
    80   @Deprecated
    81   public static Restriction neq(String alias, AnnotationType annotationType, Object value, boolean includeInheriting)
    82     throws InvalidDataException
    83   {
    84     return new AnnotationSimpleRestriction(alias, annotationType, Operator.NEQ, value, includeInheriting);
    85   }
    86 
    87   /**
    88     Create a restriction that searches for annotations
    89     less than a given value on the root or a joined entity of a
    90     query.
    91  
    92     @param alias The alias of the joined entity or null to use the root element
    93     @param annotationType The annotation type to search. Can not be null.
    94     @param value The value to search for. Can not be null.
    95     @param includeInheriting If items inheriting the annotation should be returned
    96       by the query or not
    97     @return A restriction on annotations.
    98     @throws InvalidDataException If annotationType parameter or value parameter are null.
    99     @since 2.4
    100     @deprecated In 3.5; Use{@link AnnotationSimpleRestriction} instead
    101   */
    102   @Deprecated
    103   public static Restriction lt(String alias, AnnotationType annotationType, Object value, boolean includeInheriting)
    104     throws InvalidDataException
    105   {
    106     return new AnnotationSimpleRestriction(alias, annotationType, Operator.LT, value, includeInheriting);
    107   }
    108 
    109   /**
    110     Create a restriction that searches for annotations
    111     less than or equal to a given value on the root or a joined entity of a
    112     query.
    113  
    114     @param alias The alias of the joined entity or null to use the root element
    115     @param annotationType The annotation type to search. Can not be null.
    116     @param value The value to search for. Can not be null.
    117     @param includeInheriting If items inheriting the annotation should be returned
    118       by the query or not
    119     @return A restriction on annotations.
    120     @throws InvalidDataException If annotationType parameter or value parameter are null.
    121     @since 2.4
    122     @deprecated In 3.5; Use{@link AnnotationSimpleRestriction} instead
    123   */
    124   @Deprecated
    125   public static Restriction lteq(String alias, AnnotationType annotationType, Object value, boolean includeInheriting)
    126     throws InvalidDataException
    127   {
    128     return new AnnotationSimpleRestriction(alias, annotationType, Operator.LTEQ, value, includeInheriting);
    129   }
    130 
    131   /**
    132     Create a restriction that searches for annotations
    133     greater than a given value on the root or a joined entity of a
    134     query.
    135  
    136     @param alias The alias of the joined entity or null to use the root element
    137     @param annotationType The annotation type to search. Can not be null.
    138     @param value The value to search for. Can not be null.
    139     @param includeInheriting If items inheriting the annotation should be returned
    140       by the query or not
    141     @return A restriction on annotations.
    142     @throws InvalidDataException If annotationType parameter or value parameter are null.
    143     @since 2.4
    144     @deprecated In 3.5; Use{@link AnnotationSimpleRestriction} instead
    145   */
    146   @Deprecated
    147   public static Restriction gt(String alias, AnnotationType annotationType, Object value, boolean includeInheriting)
    148     throws InvalidDataException
    149   {
    150     return new AnnotationSimpleRestriction(alias, annotationType, Operator.GTEQ, value, includeInheriting);
    151   }
    152  
    153   /**
    154     Create a restriction that searches for annotations
    155     greater than or equal to a given value on the root or a joined entity of a
    156     query.
    157  
    158     @param alias The alias of the joined entity or null to use the root element
    159     @param annotationType The annotation type to search. Can not be null.
    160     @param value The value to search for. Can not be null.
    161     @param includeInheriting If items inheriting the annotation should be returned
    162       by the query or not
    163     @return A restriction on on annotations.
    164     @throws InvalidDataException If annotationType parameter or value parameter are null.
    165     @since 2.4
    166     @deprecated In 3.5; Use{@link AnnotationSimpleRestriction} instead
    167   */
    168   @Deprecated
    169   public static Restriction gteq(String alias, AnnotationType annotationType, Object value, boolean includeInheriting)
    170     throws InvalidDataException
    171   {
    172     return new AnnotationSimpleRestriction(alias, annotationType, Operator.GTEQ, value, includeInheriting);
    173   }
    174 
    175   /**
    176     Create a restriction that searches for annotations
    177     matching a given value on the root or a joined entity of a
    178     query.
    179    
    180     @param alias The alias of the joined entity or null to use the root element
    181     @param annotationType The annotation type to search. Can not be null.
    182     @param value The value to search for. Can not be null.
    183     @param includeInheriting If items inheriting the annotation should be returned
    184       by the query or not
    185     @return A restriction on annotations.
    186     @throws InvalidDataException If annotationType parameter or value parameter are null.
    187     @since 2.4
    188     @deprecated In 3.5; Use{@link AnnotationSimpleRestriction} instead
    189   */
    190   @Deprecated
    191   public static Restriction like(String alias, AnnotationType annotationType, Object value, boolean includeInheriting)
    192     throws InvalidDataException
    193   {
    194     return new AnnotationSimpleRestriction(alias, annotationType, Operator.LIKE, value, includeInheriting);
    195   }
    196 
    197   /**
    198     Create a restriction that searches for annotations
    199     between two given values on the root or a joined entity of a
    200     query. The low/high values are included.
    201    
    202     @param alias The alias of the joined entity or null to use the root element
    203     @param annotationType The annotation type to search. Can not be null.
    204     @param lowValue The lower bound. Can not be null.
    205     @param highValue The higher bound. Can not be null.
    206     @param includeInheriting If items inheriting the annotation should be returned
    207       by the query or not
    208     @return A restriction on annotations.
    209     @throws InvalidDataException If any of the required parameters are null.
    210     @since 2.4, 3.0 (specified that low/high values are included)
    211     @deprecated In 3.5; Use{@link AnnotationBetweenRestriction} instead
    212   */
    213   @Deprecated
    214   public static Restriction between(String alias, AnnotationType annotationType, Object lowValue, Object highValue, boolean includeInheriting)
    215     throws InvalidDataException
    216   {
    217     return new AnnotationBetweenRestriction(alias, annotationType, lowValue, highValue, includeInheriting);
    218   }
    219 
    220   /**
    221     Create a restriction that searches for annotations
    222     on the root or a joined entity
    223     equal to any value in a list of given values.
    224    
    225     @param alias The alias of the joined entity or null to use the root element
    226     @param annotationType The annotation type to search. Can not be null.
    227     @param includeInheriting If items inheriting the annotation should be returned
    228       by the query or not
    229     @param values An array of values. Can not be null.
    230     @return A restriction on annotations.
    231     @throws InvalidDataException If annotationType parameter or values parameter are null
    232     @since 2.4
    233     @deprecated In 3.5; Use{@link AnnotationInRestriction} instead
    234   */
    235   @Deprecated
    236   public static Restriction in(String alias, AnnotationType annotationType, boolean includeInheriting, Object... values)
    237     throws InvalidDataException
    238   {
    239     return new AnnotationInRestriction(alias, annotationType, includeInheriting, values);
    240   }
    24138
    24239  /**
  • trunk/src/core/net/sf/basedb/core/snapshot/AnnotationSnapshot.java

    r7610 r7643  
    124124  }
    125125
    126   /**
    127     Is this annotation a primary or inherited annotation?
    128     @deprecated In 3.6, use {@link #getSource()} instead
    129   */
    130   @Deprecated
    131   public boolean isInherited()
    132   {
    133     return getSource() != Annotation.Source.PRIMARY;
    134   }
    135126 
    136127  /**
     
    141132  {
    142133    return source;
    143   }
    144 
    145   /**
    146     Get the id of the annotation this is a snapshot of.
    147     NOTE! To preserve backwards compatibility this
    148     will return {@link #getThisAnnotationId()} for
    149     primary and cloned annotations with missing parent, and
    150     {@link #getInheritedAnnotationId()} for inherited
    151     and cloned annotations.
    152    
    153     @return The id of the annotation
    154     @deprecated In 3.6, use {@link #getThisAnnotationId()} or {@link #getInheritedAnnotationId()} instead
    155   */
    156   @Deprecated
    157   public int getAnnotationId()
    158   {
    159     return inheritedFromId != 0 ? inheritedFromId : annotationId;
    160134  }
    161135 
     
    182156  {
    183157    return inheritedFromId;
    184   }
    185 
    186   /**
    187     Get the annotation this is a snapshot of. See
    188     also {@link #getAnnotationId()}.
    189    
    190     @return An Annotation object
    191     @deprecated In 3.6, use {@link #getThisAnnotation(DbControl)}
    192       or {@link #getInheritedAnnotation(DbControl)} instead
    193   */
    194   @Deprecated
    195   public Annotation getAnnotation(DbControl dc)
    196   {
    197     return Annotation.getById(dc, getAnnotationId());
    198158  }
    199159 
     
    259219    return false;
    260220  }
    261  
    262   /**
    263     Get the id of the annotation set this annotation belongs to.
    264     NOTE! To preserve backwards compatibility this
    265     will return {@link #getThisAnnotationSetId()} for
    266     primary and cloned annotations, and
    267     {@link #getInheritedAnnotationSetId()} for inherited
    268     annotations.
    269     @deprecated In 3.6, use {@link #getThisAnnotationSetId()}
    270       or {@link #getInheritedAnnotationSetId()} instead
    271   */
    272   @Deprecated
    273   public int getAnnotationSetId()
    274   {
    275     return inheritedFromSetId != 0 ? inheritedFromSetId : annotationSetId;
    276   }
    277221
    278222  /**
     
    298242  {
    299243    return inheritedFromSetId;
    300   }
    301  
    302   /**
    303     Get the annotation set this annotation belongs to.
    304     @deprecated In 3.6, use {@link #getThisAnnotationSet(DbControl)}
    305       or {@link #getInheritedAnnotationSet(DbControl)} instead
    306   */
    307   @Deprecated
    308   public AnnotationSet getAnnotationSet(DbControl dc)
    309   {
    310     return AnnotationSet.getById(dc, getAnnotationSetId());
    311244  }
    312245 
     
    386319  /**
    387320    Get the id of the unit that the annotation values should
    388     use when displayed.
    389     @return The unit id, or 0 if this annotatation doesn't use units
    390     @since 3.4
    391     @deprecated In 3.6, use {@link #getThisUnitId()} or
    392       {@link #getInheritedFrom()}.getThisUnitId() instead
    393   */
    394   @Deprecated
    395   public int getUnitId()
    396   {
    397     return inheritedFrom != null && unitId == 0 ? inheritedFrom.unitId : unitId;
    398   }
    399  
    400   /**
    401     Get the id of the unit that the annotation values should
    402321    use when displayed.
    403322    @since 3.6
     
    407326    return unitId;
    408327  }
    409  
    410   /**
    411     Get the unit.
    412     @return A Unit object or null if this annotation doesn't use units
    413     @since 3.4
    414     @deprecated In 3.6, use {@link #getThisUnit(DbControl)} or
    415       {@link #getActualUnit(DbControl)} instead
    416   */
    417   @Deprecated
    418   public Unit getUnit(DbControl dc)
    419   {
    420     int id = getUnitId();
    421     return id == 0 ? null : Unit.getById(dc, id);
    422   }
    423  
     328
    424329  /**
    425330    Get the unit the annotatation values should use for display.
     
    448353  }
    449354
    450   /**
    451     Get the annotation values.
    452    
    453     @return A list with the values
    454     @deprecated In 3.6, use {@link #getActualValues()} or {@link #getThisValues()} instead
    455   */
    456   @Deprecated
    457   public List<? extends Serializable> getValues()
    458   {
    459     return getActualValues();
    460   }
    461  
    462355  /**
    463356    Get the annotation values for this annotation. NOTE! The values are only
     
    484377    return (List<T>)(inheritedFrom != null && values == null ? inheritedFrom.values : values);
    485378  }
    486  
    487  
     379   
    488380  /**
    489381    Get the annotations values, optionally converted to some specific unit
     
    500392      no converter is specified)
    501393    @return A list with the values
    502     @deprecated In 3.6, use {@link #getActualValues(UnitConverter, Type)} instead
    503   */
    504   @Deprecated
    505   public <T extends Serializable> List<T> getValues(UnitConverter converter, Type valueType)
    506   {
    507     return getActualValues(converter, valueType);
    508   }
    509  
    510   /**
    511     Get the annotations values, optionally converted to some specific unit
    512     and type of values.
    513    
    514     NOTE! To create a unit converter that converts that values to the unit
    515     specified by {@link #getUnit(DbControl)}:
    516    
    517     this.getUnit(dc).getUnitConverter(this.getAnnotationType(dc).getDefaultUnit())
    518    
    519     @param converter A converter for converting (numerical) values,
    520       or null to not convert the values
    521     @param valueType The return type of the converted values (ignored if
    522       no converter is specified)
    523     @return A list with the values
    524394    @since 3.6
    525395  */
     
    571441 
    572442  /**
    573     Get the id of the item this annotation belongs to.
    574     @deprecated In 3.6, use {@link #getThisItemId()} or
    575       {@link #getInheritedFrom()}.getThisItemId() instead
    576   */
    577   @Deprecated
    578   public int getItemId()
    579   {
    580     return inheritedFrom != null ? inheritedFrom.itemId : itemId;
    581   }
    582  
    583   /**
    584443    Get the id of the item this annotation belongs to. NOTE! this value
    585444    is only available on annotations returned from the call to:
     
    590449    return itemId;
    591450  }
    592  
     451
    593452  /**
    594453    Get the item that this annotation belongs to.
    595454    @return The item, or null if the item is not know
    596     @deprecated In 3.6, use {@link #getThisItem(DbControl)} or
    597       {@link #getInheritedFrom()}.getThisItem(DbControl) instead
    598   */
    599   @Deprecated
    600   public Annotatable getItem(DbControl dc)
    601   {
    602     return getItemId() == 0 ? null : getItemType().getById(dc, getItemId());
    603   }
    604 
    605   /**
    606     Get the item that this annotation belongs to.
    607     @return The item, or null if the item is not know
    608455    @since 3.6
    609456  */
     
    612459    return itemId == 0 ? null : itemType.getById(dc, itemId);
    613460  }
    614  
    615   /**
    616     Get the item type of the item this annotation belongs to.
    617 
    618     @return The item type, or null if not known
    619     @deprecated In 3.6, use {@link #getThisItemType()} or
    620       {@link #getInheritedFrom()}.getThisItemType() instead
    621   */
    622   @Deprecated
    623   public Item getItemType()
    624   {
    625     return inheritedFrom != null ? inheritedFrom.itemType : itemType;
    626   }
    627 
    628461 
    629462  /**
Note: See TracChangeset for help on using the changeset viewer.