Questions tagged [transient]

In ORM and OOP , a transient field is generally a field that isn't included in the serialization process. Use this tag for questions related to behavior related to the transient keyword.

414 questions
0
votes
2 answers

How does the @Transient annotation get its value?

So I understand that the @Transient from javax.persistence.Transient marks that a property or field is not persistent. But how does this property or field know what data it should be populated with.
stef52
  • 1,089
  • 2
  • 15
  • 23
0
votes
1 answer

Grails domain class transient collection attribute setter issue

I am trying to set (or bind) value to a transient List attribute. But I failed with collections. On the other hand transient String attribute working well on setter. Grails version 2.4.3 Any advice? @Resource(uri = "/api/samples", formats =…
daimon
  • 173
  • 1
  • 7
0
votes
1 answer

Hook when switching between blogs in WordPress multisite?

Is there a hook for WordPress multisite that I can use when a user switches between blogs in the Dashboard? I need to clear some transients when the user is logged in the Dashboard, but only if she switched from one blog to another.
alkah3st
  • 25
  • 1
  • 8
0
votes
1 answer

what happens in hibernate if i give a column tag for a transient variable?

What happens in hibernate if i give a column tag for a transient variable? @Table(name="team") public class Team extends BaseObject implements Serializable { @Id @GeneratedValue(strategy=GenerationType.AUTO) private Long…
0
votes
2 answers

Are transient objects safe from double-checked locking?

Are transient objects safe from double-checked locking? private transient java.lang.ThreadLocal __hashHistory; public int hashCode() { if (__hashHistory == null) { synchronized (this) { if (__hashHistory == null) { …
Zibbobz
  • 725
  • 1
  • 15
  • 41
0
votes
1 answer

JPA @Transient Value being recalled

I have an entity Ticket.class that has the following properties (amongst others): @OneToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE}) private List comments; @Transient private Comment comment; I then have a…
tarka
  • 5,289
  • 10
  • 51
  • 75
0
votes
1 answer

Filter sections of NSFetchedResultsController with Transient sectionNameKeyPath

I'm trying to limit the sections shown based on user input. This part of my app resembles Apple's Custom Section Titles example a lot. Apple's example shows sections by month and year. I want to filter these results by a user selected input. For…
0
votes
1 answer

Datanucleus Query: accessing transient collection after close

I have a specific query method in all my managers that must return a transient collection, but i want to CLOSE the query immediately after executing it. tx.begin(); Query query=pm.newQuery(...); Collection…
marcolopes
  • 9,232
  • 14
  • 54
  • 65
0
votes
1 answer

How do I view/set the transient message status bar in Firefox and Chrome?

I added a new transient status bar message to my HTML document (specifically the 5 links listed in the table, see code below) and it worked fine in IE but when I viewed the document in Firefox or Chrome the message did not appear. All that I saw was…
Ashley
  • 1,125
  • 8
  • 16
  • 27
0
votes
2 answers

Morphia : Using Transient

I have an object which has 3 fileds: public class tags{ @Property("n") private String name; @Property("t") private int type; @Property("r") private int rank; ..... } I am using morphia to communicate to my MongoDB. I want to save al lthe fileds…
Pi Horse
  • 2,350
  • 8
  • 30
  • 51
0
votes
1 answer

Does JPA 2.0 support user defined types?

Does JPA 2.0 support user defined types? I'm using OpenJPA. I have looked through the 2.0 spec, and I did not see anything about user defined types. I am a bit surprised, did I miss something? By user defined types, I mean like Hibernate allows. For…
user2800708
  • 1,890
  • 2
  • 18
  • 31
0
votes
0 answers

If using CascadeType.ALL I get Detached error. If not, get Transient error

SOLVED: I have three related classes in the entity but only one receives value (according to the option that is selected). In this case, the option that have value is given Detached and the other two are Transient. The solution was set Null for not…
0
votes
3 answers

Transient field causing serializeable error

I have a class that has marked two fields serilizeable @Transient private List edges; @Transient private List cells; and this works when I get instances of this from the server to my application. Which is an application client. When I…
onesixtyfourth
  • 744
  • 9
  • 30
0
votes
0 answers

serializable issue with Context and transient

I'm facing an issue with Parcelable and Serializable. All my attributes from a class are Serializable unless Context. In the case of Context I've done this object transient so I shouldn't have Serializable problems. My issue is that I keep having…
Jose M Lechon
  • 5,766
  • 6
  • 44
  • 60
0
votes
1 answer

Why @Transient of ejb3 is not working as expected? It still gets persisted

import javax.persistence.*; simple POJO class A { @Transient protected transient someClass X; } Despite this, in the database, I still see it persisted? Any idea of this weird behavior?
rhozet
  • 542
  • 1
  • 6
  • 17