transient

Null transient attributes

Hello, I have a method annotated with @PrePersist annotation but I've seen that when this method is executed all my transient attributes (the attributes with the @Transient annotation) are null. When I debug the applicaion I can see that this transient attributes are not null just before calling the persist() method and when it enters...

readObject() vs. readResolve() to restore transient fields

According to Serializable javadoc, readResolve() is intended for replacing an object read from the stream. But surely (?) you don't have to replace the object, so is it OK to use it for restoring transient fields and return the original reference, like so: private Object readResolve() { transientField = something; return this; }...

I have a feeling that adding fields marked with @Transient annotation to entity is very bug-prone. Am I right?

I have some philosophical intuitive feeling that adding fields which doesn't mapped to the DB corrupts entity classes and is a wrong way of solving problems. But are there any concrete situations where using @Transient fields leads to implicit and hard fixing problems? For example, is it possible that adding or removing 2nd level cache...

Should @Transient property be used in equals/hashCode/toString?

Hi there, this is a quick question: I have JPA entities where some properties are annotated with @Transient. Shall I use these properties in equals/hashCode/toString methods? My first thought is NO but.... I don't know why. Tips? Ideas? Explanations? Thanks in advance ...

Wordpress Transient

I am trying to learn some new database techniques and at the moment, I have a opportunity to apply and try something new. Wordpress coined some of it's values: "transient" and lock it on to a key value. Example Value: a:20:{i:-1273996637;i:1284;i:-1273997086;} What I like to know is the concept on how these values are created. ...

Write object with transient attributes to stream (Java)

I want to write an object into a stream (or byte array) with its transient attributes to be able to reconstruct it in another VM. I don't want to modify its attributes because that object is a part of legacy application. Standard Java serialization mechanism doesn't help. What other options do I have? Update: The reason I'm asking the...

Why is there no peek! function for clojure transient vectors?

Clojure has transient analogs for some of its persistent data structures, vectors, maps and sets. For vectors, there are pop! and conj! functions, analogous to pop and conj for persistent vectors, but no peek!. Is there a technical reason that makes an efficient implementation of peek! impossible? Or is it just not necessary in most...

Fluorine TransientAttribute and Linq-to-SQL

I've found a workaround, but I had trouble earlier this week working with FluorineFx, where I had a Linq-to-SQL–generated object I wanted to send over the wire to Flash. This object contained a property that Flash didn't need: [Association(Name="User_UserEntry", Storage="_UserEntries", ThisKey="UserID", OtherKey="UserID")] ...

Doctrine adding a many-to-many relation for transient records

two models Site and Language share a many-to-many relationship (they are bi-directional) How do I add a relationship between them? Ideally I want to do this : (add an existing language to a new Site) $site = new Site(); $site->name = "Google" $site->url = "www.google.com"; ---- code to add language---- $site->save(); Or should I onl...

Can a field's transient property/flag be set through reflection in java?

Is there a simple way to specify if a field should be transient or not in Java with reflection, similar to how a field's accessibility flag can be set with setAccessible()? ...

Windsor Castle IoC Thread Safety Static Variables

I have a question for the Ioc gurus out there. I am working with a co-worker to wrap our minds around Castle Windsor IoC. We are having a difference of opinion about static Domain Service objects within asp.Net webforms. We have a static factory called BLServiceFactory in our Infrastructure layer that retrieves the container. public sea...

AutoMapper classes with a Transient lifestyle in IoC

I'm using AutoMapper to map domain entities to view models in an Asp.Net MVC app. I register these mapping classes in Castle Windsor so they are available to the controller thru ctor dependency injection. These mapping classes has a virtual CreateMap method where I can override AutoMapper's mapping, telling it how to map fields from th...

avoiding duplicate transient instance in nhibernate

My main entity (Account) graph looks like the following: Account Manager SalesPerson Trader The Manager, SalesPerson and Trader entity are of type person. Now while creating the main entity (along with inner entities) I need to create a new Person if it doesnt already exist. This introduces a problem, where in if the same (...

Castle Windsor - Lookup Method Injection for transient instances

Hello all, The short question: Does Castle Windsor have something similar to Spring.Net's "Lookup Method Injection" that can be configured from XML, which provides the ability to fetch transient instances from the container without the class being aware of the IoC container? The long question: I'm a long time Spring/Spring.Net user and...

SPARQL get all nodes of transient relation

Is it somehow possible to get the list of nodes connected through a transient relation with SPARQL? I have elements that are connected in this way: ?a g:eastOf ?b ?b g:eastOf ?c ... Not all nodes are connected with each other, because some are further down south. Only when nodes are vertically at the same plain there might be a g:eas...