Questions tagged [xmltransient]
16 questions
8
votes
2 answers
Hide an entity variable from xml message - @XmlTransient not working
I have an entity class:
public class Customer implements Serializable {
private static final long serialVersionUID = 1L;
@XmlTransient
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name =…

David031
- 119
- 1
- 2
- 8
5
votes
1 answer
JAXB multiple inheritance propOrder
I have a structure like
public class Grandpa...
public class Father extends Grandpa...
public class Son extends Father...
I want to marshall it to file with propOrder annotation.
So i can use @XmlTransient on Grandpa and set propOrder on Father…

Eugene Kisly
- 129
- 12
3
votes
0 answers
Exclude type element from marshalled generic type in Moxy
I am marshalling an object to json using Moxy 2.5.1. The object extends a generic class. I don't want the type element output, so I tried following the example at http://blog.bdoughan.com/2011/06/ignoring-inheritance-with-xmltransient.html.
That…

John Douglass
- 313
- 3
- 10
3
votes
3 answers
Jackson jaxb runtime disable @XmlTransient annotation for specified fields
I am using Jackson (jaxb) for JSON marshalling and unmarshalling.
For example here I have annotated address field XmlTransient because I don't want it to be mapped when person records are listed (Security and Speed concerns), address field is lazy…

Pinchy
- 1,506
- 8
- 28
- 49
3
votes
1 answer
@XmlTransient ignored in generating WSDL - Axis2 WS
I've got a class
public class Calculator {
public Test getTest(){
return new Test();
}
}
That I want to expose as Web Service. The Test definition is:
public class Test {
private Test2[] tests;
@XmlTransient
public…

andreaxi
- 931
- 5
- 15
- 28
3
votes
3 answers
RestEasy 2 not obeying @XmlTransient
My Entity has a property,
@Embedded
@XmlTransient
private ReleaseTraits traits;
@XmlTransient
public ReleaseTraits getTraits() {
return traits;
}
But RestEasy (in JBoss AS 7.1) keeps putting it to the JSON.
Also, the null values are not…

Ondra Žižka
- 43,948
- 41
- 217
- 277
2
votes
1 answer
XmlTransient annotation on getter only?
I am trying to unmarshal an XML into an object that I expect should have a certain field. However, I do not want to marshal that object into an XML that contains it. What I like would be similar to this:
@XmlRootElement(name = "User")
public class…

Joanna
- 25
- 1
- 7
2
votes
1 answer
Why doesn't XMLDecoder respect the transient keyword?
Java has a transient keyword which is used with default serialization to indicate a value that should not be serialized. However, if I use XML serialization with XMLDecoder the properties associated with that field are still serialized. I tried…

sproketboy
- 8,967
- 18
- 65
- 95
2
votes
0 answers
How to exclude Observable in XSD file generated by JAXB
I have an abstract class extending java.util.Observable. When i generate xsd using Jaxb, there appears a complex type observable in the xsd file.
@XmlAccessorType(XmlAccessType.NONE)
public abstract class MyClass extends Observable implements…

Bren
- 2,148
- 1
- 27
- 45
2
votes
2 answers
Xml transient not working jaxb(Moxy).?
Xml transient annotation not working for following model-
@XmlRootElement
public class JdfValidation {
private String name;
private String dataType;
private String errorMessage;
private String javaValidationLogic;
protected String…

vishal
- 25
- 1
- 8
0
votes
1 answer
XML Transformation in Azure APIM
Suppose I have a XML like:
Note: This is only 4 rows what I have provided but it is having so many rows (B tag).
I want to transform it…

Rishav Raj
- 93
- 5
0
votes
0 answers
Taking out @XmlTransient creates 500 server error
This is bugging me a lot. I understand that using @XmlTransient in a java entity excludes the relationship of the entity from the Json or Xml conversion in a web service e.g., RESTFul web service. But sometime you need to include the relationship…

JediSal
- 65
- 4
0
votes
2 answers
JAXB marshals "non-field"
I have a class called Ability that inherits from an abstract class CampaignObject.
CampaignObject has an abstract method called getInfo().
Abilities do not have their own Info. If they are asked for info, the info of their Owner should be…

Stefan Fischer
- 363
- 4
- 19
0
votes
1 answer
Use @XmlTransient only in some cases
I have two classes:
public class A implements Serializable {
...
@OneToMany(cascade = CascadeType.ALL, mappedBy = "fieldID")
private Collection bCollection;
...
public Collection getBCollection()
{
return…

Yan Ivan Evdokimov
- 179
- 1
- 4
- 15
0
votes
1 answer
How to add @XmlTransient annotation with XJC for properties
I have an XSD and want to mark some properties as XmlTransient, so that the properties will be generated in Java by XJC and ignored by marshalling and unmarshalling by JAXB.
I can modify the XSD and dont know what I should put into xs:annotation tag…

Martin Dames
- 264
- 3
- 13