Java Code Examples for javax.persistence.Transient

The following are top voted examples for showing how to use javax.persistence.Transient. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: kafka-webview   File: View.java   Source Code and License 6 votes vote down vote up
/**
 * @return Returns the defined partitions as a Set.
 */
@Transient
public Set<Integer> getPartitionsAsSet() {
    final Set<Integer> partitionsSet = new HashSet<>();

    // Avoid NPE.
    if (getPartitions() == null) {
        return partitionsSet;
    }

    final String[] partitions = getPartitions().split(",");

    for (final String partitionStr: partitions) {
        try {
            partitionsSet.add(Integer.parseInt(partitionStr));
        } catch (NumberFormatException e) {
            // Ignore?
        }
    }
    return partitionsSet;
}
 
Example 2
Project: oasp-tutorial-sources   File: VisitorEntity.java   Source Code and License 5 votes vote down vote up
@Override
@Transient
public Long getCodeId() {

  if (this.code == null) {
    return null;
  }
  return this.code.getId();
}
 
Example 3
Project: stroom-stats   File: StroomStatsStoreEntity.java   Source Code and License 5 votes vote down vote up
@Override
@Transient
public List<String> getFieldNames() {
    if (stroomStatsStoreDataObject != null) {
        final List<String> fieldNames = new ArrayList<String>();
        for (final StatisticField statisticField : stroomStatsStoreDataObject.getStatisticFields()) {
            fieldNames.add(statisticField.getFieldName());
        }
        return fieldNames;
    } else {
        return Collections.emptyList();
    }
}
 
Example 4
Project: stroom-stats   File: StroomStatsStoreEntity.java   Source Code and License 5 votes vote down vote up
@Transient
public List<StatisticField> getStatisticFields() {
    if (stroomStatsStoreDataObject != null) {
        return stroomStatsStoreDataObject.getStatisticFields();
    } else {
        return Collections.emptyList();
    }
}
 
Example 5
Project: stroom-stats   File: StroomStatsStoreEntity.java   Source Code and License 5 votes vote down vote up
@Override
@Transient
public Set<? extends CustomRollUpMask> getCustomRollUpMasks() {
    if (stroomStatsStoreDataObject != null) {
        return stroomStatsStoreDataObject.getCustomRollUpMasks();
    } else {
        return Collections.emptySet();
    }
}
 
Example 6
Project: yadaframework   File: YadaProduct.java   Source Code and License 5 votes vote down vote up
/***********************************************************************/
/* Id for DataTables                                                   */

@Transient
@JsonView(YadaJsonView.WithEagerAttributes.class)
@JsonProperty("DT_RowId")
public String getDT_RowId() {
	return this.getClass().getSimpleName()+"#"+this.id; // YadaProduct#142
}
 
Example 7
Project: kafka-webview   File: Filter.java   Source Code and License 5 votes vote down vote up
/**
 * @return All of the option names, as a set.
 */
@Transient
public Set<String> getOptionsAsSet() {
    final Set<String> set = new HashSet<>();
    Collections.addAll(set, getOptions().split(","));
    return set;
}
 
Example 8
Project: Equella   File: LanguageBundle.java   Source Code and License 5 votes vote down vote up
@Transient
public boolean isEmpty()
{
	if( strings != null )
	{
		for( LanguageString string : strings.values() )
		{
			if( !Check.isEmpty(string.getText()) )
			{
				return false;
			}
		}
	}
	return true;
}
 
Example 9
Project: lams   File: JPAOverriddenAnnotationReader.java   Source Code and License 5 votes vote down vote up
private Transient getTransient(XMLContext.Default defaults) {
	for ( Element element : elementsForProperty ) {
		if ( "transient".equals( element.getName() ) ) {
			AnnotationDescriptor ad = new AnnotationDescriptor( Transient.class );
			return AnnotationFactory.create( ad );
		}
	}
	if ( elementsForProperty.size() == 0 && defaults.canUseJavaAnnotations() ) {
		return getPhysicalAnnotation( Transient.class );
	}
	else {
		return null;
	}
}
 
Example 10
Project: yadaframework   File: YadaUserMessage.java   Source Code and License 5 votes vote down vote up
/***********************************************************************/
/* DataTables                                                          */

@Transient
@JsonView(YadaJsonView.WithEagerAttributes.class)
@JsonProperty("DT_RowId")
public String getDT_RowId() {
	return this.getClass().getSimpleName()+"#"+this.id; // YadaUserMessage#142
}
 
Example 11
Project: aws-photosharing-example   File: Media.java   Source Code and License 5 votes vote down vote up
@Transient
public String getPrivateUrl() {
    String publicUrl = "";
    if (this.getS3ThumbFileName() != null && this.getS3ThumbFileName().trim().length() > 0)
        publicUrl = MessageFormat.format(Configuration.PRIVATE_MEDIA_URL_FORMAT.toString(), this.getId());

    return publicUrl;
}
 
Example 12
Project: yadaframework   File: YadaProduct.java   Source Code and License 5 votes vote down vote up
/**
 * Fetches the localized description for the current request locale or the default configured locale
 * @return the name or the empty string if no value has been defined
 */
@Transient
public String getLocalDescription() {
	if (cacheDescription==null) {
		cacheDescription = yadaLocaleDao.getLocalValue(id, YadaProduct.class, "description", null);
	}
	return cacheDescription;
}
 
Example 13
Project: yadaframework   File: YadaPersistentEnum.java   Source Code and License 5 votes vote down vote up
/**
 * Sets the attributes of a normal enum into this instance, but not the localized text
 * @param enumValue
 */
@Transient
public void setEnum(E enumValue) {
	this.enumClassName = enumValue.getClass().getName();
	this.enumOrdinal = enumValue.ordinal();
	this.enumName = enumValue.name();
}
 
Example 14
Project: exam   File: AutoEvaluationConfig.java   Source Code and License 5 votes vote down vote up
@Transient
public AutoEvaluationConfig copy() {
    AutoEvaluationConfig clone = new AutoEvaluationConfig();
    BeanUtils.copyProperties(this, clone, "id", "exam", "gradeEvaluations");
    for (GradeEvaluation ge : gradeEvaluations) {
        clone.getGradeEvaluations().add(ge.copy());
    }
    return clone;
}
 
Example 15
Project: exam   File: EssayAnswer.java   Source Code and License 5 votes vote down vote up
@Transient
public EssayAnswer copy() {
    EssayAnswer essayAnswer = new EssayAnswer();
    essayAnswer.setAnswer(answer);
    essayAnswer.save();
    return essayAnswer;
}
 
Example 16
Project: yadaframework   File: YadaBrowserId.java   Source Code and License 5 votes vote down vote up
/**
 * Returns the UUID, or null if not set
 * @return
 */
@Transient
public UUID getUUID() {
	if (mostSigBits>0 && leastSigBits>0) {
		return new UUID(mostSigBits, leastSigBits);
	}
	return null;
}
 
Example 17
Project: tipi-engine   File: DbBooleanVariable.java   Source Code and License 4 votes vote down vote up
@Transient
@Override
public Boolean getValue() {
    return value;
}
 
Example 18
Project: tipi-engine   File: DbStringVariable.java   Source Code and License 4 votes vote down vote up
@Override
@Transient
public final String getValue() {
    return stringValue;
}
 
Example 19
Project: tipi-engine   File: DbTimestampVariable.java   Source Code and License 4 votes vote down vote up
@Transient
@Override
public Date getValue() {
    return null;
}
 
Example 20
Project: tipi-engine   File: DbLongVariable.java   Source Code and License 4 votes vote down vote up
@Transient
@Override
public Long getValue() {
    return longValue;
}
 
Example 21
Project: sjk   File: App.java   Source Code and License 4 votes vote down vote up
@Transient
public String getPageUrl() {
    return pageUrl;
}
 
Example 22
Project: sjk   File: ExtendData.java   Source Code and License 4 votes vote down vote up
@Transient
public String getImageUrl() {
    return imageUrl;
}
 
Example 23
Project: sbc-qsystem   File: QUser.java   Source Code and License 4 votes vote down vote up
@Transient
public Shadow getShadow() {
    return shadow;
}
 
Example 24
Project: DWSurvey   File: Question.java   Source Code and License 4 votes vote down vote up
@Transient
public List<QuScore> getQuScores() {
	return quScores;
}
 
Example 25
Project: DWSurvey   File: Question.java   Source Code and License 4 votes vote down vote up
@Transient
public List<QuestionLogic> getQuestionLogics() {
	return questionLogics;
}
 
Example 26
Project: sjk   File: AppDetail.java   Source Code and License 4 votes vote down vote up
@Transient
public String getLastUpdateTimeStr() {
    return lastUpdateTimeStr;
}
 
Example 27
Project: DWSurvey   File: QuOrderby.java   Source Code and License 4 votes vote down vote up
@Transient
public int getAnOrderSum() {
	return anOrderSum;
}
 
Example 28
Project: sbc-qsystem   File: QUser.java   Source Code and License 4 votes vote down vote up
/**
 * Количество услуг, которые обрабатывает юзер. // едет на коиента при логине
 */
@Transient
public int getServicesCnt() {
    return servicesCnt;
}
 
Example 29
Project: DWSurvey   File: SurveyDirectory.java   Source Code and License 4 votes vote down vote up
@Transient
public SurveyDetail getSurveyDetail() {
	return surveyDetail;
}
 
Example 30
Project: DWSurvey   File: SurveyDirectory.java   Source Code and License 4 votes vote down vote up
@Transient
public List<Question> getQuestions() {
	return questions;
}
 
Example 31
Project: stroom-stats   File: StroomStatsStoreEntity.java   Source Code and License 4 votes vote down vote up
@Transient
public int getStatisticFieldCount() {
    return stroomStatsStoreDataObject == null ? 0 : stroomStatsStoreDataObject.getStatisticFields().size();
}
 
Example 32
Project: yadaframework   File: YadaPersistentEnum.java   Source Code and License 4 votes vote down vote up
@Transient
@Override
public int hashCode() {
	return Objects.hashCode(this.enumClassName, this.enumOrdinal);
}
 
Example 33
Project: DWSurvey   File: Question.java   Source Code and License 4 votes vote down vote up
@Transient
public String[] getRemoveOptionUuIds() {
	return removeOptionUuIds;
}
 
Example 34
Project: stroom-stats   File: BaseEntity.java   Source Code and License 4 votes vote down vote up
/**
 * Reset the entity id and version to its undefined state so that it is non
 * persistent. This is often useful when copying an entity using copy.
 */
@Transient
public void clearPersistence() {
    setId(UNDEFINED_ID);
    version = -1;
}
 
Example 35
Project: DWSurvey   File: AnChenScore.java   Source Code and License 4 votes vote down vote up
@Transient
public int getAnCount() {
	return anCount;
}
 
Example 36
Project: stroom-stats   File: Entity.java   Source Code and License 4 votes vote down vote up
@Transient
public abstract boolean isPersistent();
 
Example 37
Project: stroom-stats   File: Entity.java   Source Code and License 4 votes vote down vote up
@Transient
public abstract Object getPrimaryKey();
 
Example 38
Project: stroom-stats   File: NamedEntity.java   Source Code and License 4 votes vote down vote up
@Transient
@Override
public String getDisplayValue() {
    return String.valueOf(getName());
}
 
Example 39
Project: DWSurvey   File: User.java   Source Code and License 4 votes vote down vote up
@Transient
public String getFindPwdUrl() {
	return findPwdUrl;
}
 
Example 40
Project: MybatisGeneatorUtil   File: Country.java   Source Code and License 4 votes vote down vote up
@Transient
public String getDynamicTableName() {
    return dynamicTableName123;
}
 
Example 41
Project: dhus-core   File: ConfigurationPart.java   Source Code and License 4 votes vote down vote up
@SuppressWarnings ("unchecked")
public <T extends ConfigurationPart> T getNotStoredPart()
      throws IllegalArgumentException, IllegalAccessException,
      InvocationTargetException, CloneNotSupportedException
{
   T notStoredPart = (T) this.clone ();
         
   Field[] fields = getClass().getDeclaredFields ();
   Method[] methods = getClass().getDeclaredMethods ();
   HashMap<String, Method> getters = new HashMap<String, Method> ();
   Pattern getPattern = Pattern.compile("^get([A-Z].*)");
   Pattern isPattern = Pattern.compile("^is([A-Z].*)");
   HashMap<String, Method> setters = new HashMap<String, Method> ();
   Pattern setPattern = Pattern.compile("^set([A-Z].*)");
   for (Method method : methods)
   {
      if (Modifier.isPublic(method.getModifiers()))
      {
         Matcher m;
         if (method.getParameterTypes().length == 0) 
         {
            if ((m = getPattern.matcher (method.getName ())).matches () &&
                  !method.getReturnType().equals(void.class))
            {
               getters.put (m.group(1), method);                  
            }
            else if ((m = isPattern.matcher (method.getName ())).matches ()
                  && !method.getReturnType().equals(boolean.class))
            {
               getters.put (m.group(1), method);
            }
         }
         else if (method.getParameterTypes().length == 1) 
         {               
            if ((m = setPattern.matcher (method.getName ())).matches () &&
                     method.getReturnType().equals(void.class))
            {
               setters.put (m.group(1), method);
            }
         }
      }
   }
   for (Field field : fields)
   {     
      // Do not touch to Ids
      if (field.getAnnotation (Id.class) == null)
      {
         String fieldName = field.getName ().substring (0,1).toUpperCase () +
               field.getName ().substring (1);
         Method getter = getters.get (fieldName);
         Method setter = setters.get (fieldName);

         if (getter == null || setter == null)
            continue;

         if (!Modifier.isPublic (getter.getModifiers ()))
         {
            getter.setAccessible (true);
         }
         if (!Modifier.isPublic (setter.getModifiers ()))
         {
            setter.setAccessible (true);
         }
         // Non Transient ConfigurationPart fields cause a recursive call
         if (ConfigurationPart.class.isAssignableFrom (field.getType ())
               && field.getAnnotation (Transient.class) == null)
         { 
            ConfigurationPart fullConf = (ConfigurationPart) getter
                  .invoke (notStoredPart);
            ConfigurationPart filteredConf = fullConf.getNotStoredPart ();
            setter.invoke(notStoredPart, filteredConf);
         }
         // Set all non Transient fields to null
         else if (field.getAnnotation (Transient.class) == null)
         {
            setter.invoke(notStoredPart,new Object[]{ null });
         }
      }
   }
   return notStoredPart;
}
 
Example 42
Project: tk-mybatis   File: Country.java   Source Code and License 4 votes vote down vote up
@Override
@Transient
public String getDynamicTableName() {
    return dynamicTableName123;
}
 
Example 43
Project: tasfe-framework   File: BaseEntity.java   Source Code and License 4 votes vote down vote up
@Transient
public boolean isNew() {
    return null == getId();
}
 
Example 44
Project: profile-manager   File: ProfileInformation.java   Source Code and License 4 votes vote down vote up
@Transient
public ProfileInformationPK getId() {
   return id;
}
 
Example 45
Project: sjk   File: App.java   Source Code and License 4 votes vote down vote up
@Transient
public String getEditDateStr() {
    return editDateStr;
}
 
Example 46
Project: DWSurvey   File: SurveyAnswer.java   Source Code and License 4 votes vote down vote up
@Transient
public SurveyDirectory getSurveyDirectory() {
	return surveyDirectory;
}
 
Example 47
Project: DWSurvey   File: QuCheckbox.java   Source Code and License 4 votes vote down vote up
@Transient
public Integer getAnCount() {
	return anCount;
}
 
Example 48
Project: lams   File: PropertyContainer.java   Source Code and License 4 votes vote down vote up
private static boolean mustBeSkipped(XProperty property) {
	//TODO make those hardcoded tests more portable (through the bytecode provider?)
	return property.isAnnotationPresent( Transient.class )
			|| "net.sf.cglib.transform.impl.InterceptFieldCallback".equals( property.getType().getName() )
			|| "org.hibernate.bytecode.internal.javassist.FieldHandler".equals( property.getType().getName() );
}
 
Example 49
Project: lams   File: EnhancementTask.java   Source Code and License 4 votes vote down vote up
@Override
public boolean isPersistentField(CtField ctField) {
	// current check is to look for @Transient
	return ! ctField.hasAnnotation( Transient.class );
}
 
Example 50
Project: uis   File: UisUser.java   Source Code and License 4 votes vote down vote up
@Transient
public boolean isActivated() {
    return account != null;
}
 
Example 51
Project: yadaframework   File: YadaUserMessage.java   Source Code and License 4 votes vote down vote up
@Transient
@JsonProperty
@JsonView(YadaJsonView.WithEagerAttributes.class)
public String getReceiverName() {
	return recipient!=null?recipient.getUserCredentials().getUsername():"-";
}
 
Example 52
Project: yadaframework   File: YadaTicket.java   Source Code and License 4 votes vote down vote up
@Transient
public boolean isAnswered() {
	return status!=null && status.getEnum().equals(YadaTicketStatus.ANSWERED);
}
 
Example 53
Project: ABC-List   File: Topic.java   Source Code and License 4 votes vote down vote up
@Transient
public boolean isMarkAsChanged() {
    return markAsChangedProperty.getValue();
}
 
Example 54
Project: sjk   File: MoAppAndTag.java   Source Code and License 4 votes vote down vote up
@Transient
public App getApp() {
    return app;
}
 
Example 55
Project: MMORPG_Prototype   File: CharactersQuests.java   Source Code and License 4 votes vote down vote up
@Transient
public Character getCharacter()
{
    return key.getCharacter();
}
 
Example 56
Project: sjk   File: AppDetail.java   Source Code and License 4 votes vote down vote up
@Transient
public String getSubCatalogName() {
    return subCatalogName;
}
 
Example 57
Project: esup-sgc   File: PhotoFile.java   Source Code and License 4 votes vote down vote up
@Transient
public String getFileSizeFormatted() {
    return readableFileSize(fileSize.longValue());
}
 
Example 58
Project: uckefu   File: Message.java   Source Code and License 4 votes vote down vote up
@Transient
public User getTarget() {
	return target;
}
 
Example 59
Project: sbc-qsystem   File: QPlanService.java   Source Code and License 4 votes vote down vote up
@Transient
public int getKilled() {
    return killed;
}
 
Example 60
Project: sbc-qsystem   File: QCustomer.java   Source Code and License 4 votes vote down vote up
@Transient
public LinkedList<LinkedList<LinkedList<Long>>> getComplexId() {
    return complexId;
}