avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aleksey Maslov <Aleksey.Mas...@Lab49.com>
Subject How to add custom code to avro generated Java objects?
Date Mon, 14 Mar 2011 17:06:17 GMT
Hi,

Is there a way to specify inter dependencies between object methods in IDL?
For example, if object tracks 2 symmetrical properties that have perfect
-1/+1 correlation; when one is updated, the other needs to be updated (in
opposite direction in case of -1 corr); Ex:

record CredtiCardStatement {
double balance;
double payed;
}

so paying 100 units should decrease the balance by 100 units; 

any way to specify such dependencies in the IDL? 
Or if I add this code to the generated Java file, is there a way to merge
future re-generations of the record from IDL -> avro protocol -> java, not
override it;

I am trying to smarten-up my java representations of avro data objects i get
from generating from IDL but how can i preserve my changes, as i modify the
IDL and re-generate the java object definitions?

Thank you,
Aleksey


--
View this message in context: http://apache-avro.679487.n3.nabble.com/How-to-add-custom-code-to-avro-generated-Java-objects-tp2676654p2676654.html
Sent from the Avro - Users mailing list archive at Nabble.com.

Mime
View raw message