override « Default « JPA Q&A





1. Can you override orphanremoval's default implementation?    forum.hibernate.org

The current project I am working on has the need to not hard delete anything. instead, I mark a column named "retired" as true when we do not want something to be shown in the application any longer. My question is this, is there a way to override the default action of the orphanremoval process so that instead of the record ...

2. Overriding Default Hibernate Types    forum.hibernate.org

Hibernate version: 2.1 Is there a way to force hibernate to use a UserType in place of a built in type by default? Basically, I have a user type for String objects which deals with Oracle issues related to not supporting empty strings. The user type basically plugs in a char(0) when an empty string is passed, and reads in an ...

3. override default types    forum.hibernate.org

hi- I have a strange situation in my mysql database where I have a char(1) column with an empty string in some rows. The default java.lang.Character type will throw a StringIndexOutOfBoundsException for these empty strings. I logged a bug to just change the empty strings to nulls for the default CharacterType, but it was rejected on the grounds that empty strings ...

4. Override default type mapping    forum.hibernate.org

Is there an "easy" way to override Hibernate's default type mappings? Or replace a built-in type? Specifically, I want all java.util.Date properties to map to a UserType that converts to and from GMT time zone. And I want any queries that use times as parameters to use the UserType. I could explicitly map the columns to the user type and use ...

5. Criteria query fails to override default lazy fetch behavior    forum.hibernate.org

CREATE TABLE A ( ID NUMBER NOT NULL, CONSTRAINT PK_A PRIMARY KEY ( ID ) ) ; CREATE TABLE B ( ID NUMBER NOT NULL, A_ID NUMBER ...

6. Can I "override" default persistent class with sub    forum.hibernate.org

Hi lorban, I carefully looked at the feature you mentioned, and I even wrote a testcase. The approach is useful when subclasses of a superclass live together in the table. My situation is different : the subclass (only one exists) SUBSTITUTES the superclass. I would except then the persistence layer to retrieve instances of the substitute and not of the ...