-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Problem with @AccessType("property")
PostPosted: Fri Jul 02, 2010 3:53 pm 
Newbie

Joined: Fri Jul 02, 2010 3:06 pm
Posts: 2
Hi all,

I have the following entity:
@Entity
public class FormattedDate {
@Id
private Long id;

@Transient
private SimpleDateFormat sdf;
...
@AccessType("property")
@Column(name="format")
public String getFormat() {
return sdf.toPattern();
}

public void setFormat(String format) {
this.sdf = new SimpleDateFormat(format);
this.sdf.setLenient(false);
}
..
}

So I supose that when I save a FormattedField object to database, the property 'format" should be saved too.
But in my tests it didn't work.

Does anyone know exactly how the AccessType annotation works? Or how could I get the behavior I need?

Thanx


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.