persist « Property « JPA Q&A





1. JPA property java.net.URL    stackoverflow.com

HI, I have an object which has a piece of URL-Information associated with it. Currently I save this URL in a simple String property, but java.net.URL would provide me with additional goodies such ...

2. Asking help for many-to-many properties persistence in Hibernate    stackoverflow.com

Here I have a question about persist many-to-many properties. Example:

class Movie {
    /**
     * @hibernate.bag cascade="save-update" table="movie_genre"
     * @hibernate.collection-key column="ITEM_ID"
  ...

3. not persistent property    forum.hibernate.org

Hi guys, I've a question, I'm a newbie. I've a hibernate object, that implemens java.io.Serializable. Object properties are name, surname, birthdate, that are all persistent and mapped with mapping file. What I need is a fourth property, age, not mapped to db, that I want to get in my application to runtime calculate age, basing on birthdate that is mapped to ...

4. add a property to persistent class    forum.hibernate.org

// Get the existing mapping for User from Configuration PersistentClass userMapping = cfg.getClassMapping(User.class); // Define a new column for the USER table Column column = new Column(); column.setType(Hibernate.STRING); column.setName("Krishna"); column.setNullable(false); column.setUnique(true); userMapping.getTable().addColumn(column); // Wrap the column in a Value SimpleValue value = new SimpleValue(); value.setTable(userMapping.getTable()); value.addColumn(column); value.setType(Hibernate.STRING); // Define a new property of the User class Property prop = new Property(); ...

5. Non-persistable object but needing property persisted    forum.hibernate.org

I have a situation that is a little unique to an application that is being developed and curious if Hibernate is able to handle it. So far I have been messing around with it but haven't got it to work. I will be using example classes / data tables but it reflects a similar situation to the application. The mapping is: ...