• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I map a java.awt.Point to column x and column y?

 
Jane Jukowsky
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, maybe it's not java.awt.Point per se, but something very similar.

I can not have separate setX() and setY() in my model, it will make things a lot harder. I only have getLocation() and setLocation(). But I don't want that to map to a separate LOCATIONS table, that would be crazy. What do I do?

Thanks!

Edit: I am talking Hibernate, with annotations.
 
Jane Jukowsky
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Found one way: make private getters and setters for x and y; make location transient (if that's the right word).

Is there a more elegant/generic way to do the same?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic