1. Creating a custom Hibernate UserType - What does isMutable() mean? stackoverflow.comI am creating a custom UserType in Hibernate for a project. It has been relatively straightforward until I came to the isMutable method. I am trying to figure out what this ... |
2. Hibernate custom UserType isn't working stackoverflow.comI've created a UserType (see below) to handle a situation in our mySQL database where we've been saving null dates as 0000-00-00 00:00:00. When I try and persist my entity with a ... |
3. Custom hql's date_add doesn't return time correctly stackoverflow.comI'm using custom hql to invoke a date function date_add in MySql. This is how I define the Dialect:
|
4. Writing EnhancedUserType for saving String alike information in Hibernate, avoiding SQL-Injection stackoverflow.comI have some entity like an Address. Because of performance issues I want to save the whole entity in a single field, like "street;zip;city". One can create a EnhancedUserType to do that. ... |
5. Dealing with Custom User Types as an Array in Hibernate coderanch.comHi, I have 2 tables Table A: number number, name1 varchar20, name2 varchar20, name3 varchar20, name4 varchar20, name5 varchar20, name6 varchar20, name7 varchar20, name8 varchar20, name9 varchar20, name10 varchar20, name11 varchar20, name12 varchar20, name13 varchar20, name14 varchar20, name15 varchar20. etc.. Table B: name varchar20, x number, y number, etc... name field on Table B is refered by all the 15 columns ... |
6. How to make Custom UUID or ID in Hibernate? coderanch.com |
7. Custom UserType forum.hibernate.orgI have the following problem which I can not yet understand how to solve: I need to treat some String fields of some objects (but not all of them) in hibernate mapping as NVARCHAR for MS SQLServer, hence they should be saved in SQL as N' |
8. Custom Usertype forum.hibernate.orgThanks for the suggestion, I was hoping that there was a way to configure hibernate to use a custom usertype instead of one of it's build in types. Setting it in the configuration file or something so I only had to do it one place. I not going to hack the class files, then I will rather create a little tool ... |
9. Custom UserType with 2 Columns forum.hibernate.orgI have a custom UserType with 2 columns defined but when trying to query the object it seems that hibernate is building a query which is invalid. My UserType has 2 columns a timestamp and an int (for capturing milliseconds) in MySQL. When attempting to do an HQL DateRange Query I do the following: select count(a) from Entity a where a.time ... |
10. Custom YesNoType and UserType forum.hibernate.org |
11. MappingException resolving custom Hib UserType forum.hibernate.orgNewbie Joined: Wed Dec 29, 2010 6:36 pm Posts: 4 Hi! Just switched to JBoss 6 from Tomcat. Have been using Hibernate 3.6 all along and my package libraries are unchanged. Finally got thru JBoss classloading and am now presented with the following Hibernate exception. I use a handful of custom UserTypes. Mappings are defined in hbm.xml still. Entity and mapping ... |
12. Custom Tuplizer or use Transient annontation forum.hibernate.orgUsing Hibernate 3.6 Have 2 entities Element and Relation. In the Element mapping (XML mapping): Code: |
13. custom IdentifierGenerator & UserType forum.hibernate.org |
14. Yo, my custom UserType getting LazyInitializationException forum.hibernate.orgHello, I wrote a UserType to serialize a Map variable to a varchar column. I included the code for this below. It works fine for inserting. But when I attempt to retrieve (after restarting JBoss) the parent business object, TaskVO, I get a LazyInitializationException. Any ideas on the cause? FYI I'm retrieving a collection of TaskVOs via a stateless Session Bean, ... |
15. Custom UserType forum.hibernate.org |
16. Properties as custom data types forum.hibernate.orgI have a number of situations where I want a property to be a custom data type. This might for example be a SocialSecutiryNumber which is constructed with a string but is not a String. I might also use a custom enumerated type where the instance is returned by a factory method. In the absence of simply adding getter and setter ... |
17. custom types without implementing UserType ? forum.hibernate.org |
18. Custom UserType for Postgis forum.hibernate.orgI'm trying to make a custom UserType for postgis points. I'm not exactly sure what I am supposed to be doing in nullSafeGet and nullSafeSet. The examples seem to be wrapping a call to net.sf.hibernate.Hibernate.STRING.nullSafeGet and Set. Should I be getting and setting the org.postgis.Point type in these methods or getting and setting my custom UserType? |
19. Boolean custom type - Y or null (y-true,null-false) forum.hibernate.orgDavid, It isn't work - CustomType class check returnedClass (boolean.class), not my user type. Class work fine - I test, load, save, delete This is class : package yu.co.snpe.hibernate; import java.io.Serializable; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Types; import net.sf.hibernate.HibernateException; import net.sf.hibernate.UserType; import net.sf.hibernate.util.EqualsHelper; public class YesOrNullUserType implements Serializable,UserType { private final String stringTrue = "Y"; public int[] sqlTypes() { ... |
20. Custom user type to support last modified date forum.hibernate.orgGuess you've set dynamic-update=true? Set it to false and hibernate sets all fields up on update. AFAIK you cannot get this working only with a user type and have dynamic-update=true. If you want to keep dynamic-update=true you must use an interceptor, set the filed in onFlushDirty or mark it as dirty in isDirty and set the value in a user type. ... |
21. Custom Null Types forum.hibernate.org |
22. How to use Custom Collection Type for multidimensional array forum.hibernate.org |
23. Custom UserType deployment problem when using har archives. forum.hibernate.orgThe following code seems to run fine when I'm using hibernate outside of the JBoss container. When I package it up inside of a har, and attempt to deploy it, I get the following interpretation exception. This har was working perfectly until I refactored the Address object to use a custom UserType which was implemented for a US state enum. Currently ... |
24. Custom UserType example forum.hibernate.orgI think that the use of one-to-many relationship is not suitable for my context. I have a matrix of float for every row of a table. The typical dimension of the matrix is 90*14, but sometimes its 90*1. So I suppose that the use of an internal codification of a CLOB field is better for me. Example (for more than one ... |
25. Creating a custom UUID-class forum.hibernate.orgHibernate version: 3.0.5 Name and version of the database you are using: PostGres 8 / Oracle 10g We have been discussing different ways to ensure type-safety for uuid-based ids when accessing Hibernate-persisted objects through an EJB session bean. Our application is supposed to be full-blown J2EE, so we have created a number of DTO-classes that are the "serializable representation" of our ... |
26. Custom Usertype fails when attemptin to save null into DB forum.hibernate.orgI've created a custom GeometryUserType that allows me to map an Oracle SDO_Geometry to a JGeometry object. I have a "Collect" class that contains a local variable "mbr" that is of type JGeometry. Collect objects are mapped to the DB via the mapping file below. Problem: session.save(myCollect) works fine as long as myCollect.mbr is not null. However, if mbr is null ... |
27. Custom representation of boolean type in DB forum.hibernate.org |
28. Custom UserType for Entity? forum.hibernate.orgHi all, I'd like to implement custom usertype for one of my entities. The question is, how to describe and handle the identity of the objects? I would really like Hibernate to generate the identites, like it does with @Id @GeneratedValue tags, but apparently this cannot be combined with custom usertypes, or can it? All examples I have found so far ... |
29. Issue - call Oracle procedure with custom data type forum.hibernate.orgI have a custom date TYPE in Oracle like CREATE TYPE DATEARRAY AS TABLE OF DATE; it will create TYPE, like date array and I have a Oracle function also like CREATE OR REPLACE FUNCTION doesContain (list DATEARRAY, val VARCHAR2) RETURN NUMBER IS .... .... .... END doesContain; In my Java class, I have a collection which contain a list of ... |
30. Custom UserType not working forum.hibernate.orgI am using the exact custom UserType recommended here to trim spaces off CHAR fields: http://www.hibernate.org/388.html I have the map file referencing this custom usertype as the "type" value like so: Code: |
31. Custom type for nullable boolean forum.hibernate.orgpublic String getRenderText(SessionFactoryImplementor sessionFactory) { try { return getTypeInternal().objectToSQLString( getValue(), sessionFactory.getDialect() ); } catch( Throwable t ) { throw new QueryException( "Unable to render boolean ... |
32. Casting to Custom Type forum.hibernate.orgHi to all, I've created a custom type for storing a money amount using a big decimal for the property in the java class, thus in the mapping document's I can use AMOUNT as property type. It work, but when I write queries in HQL I cannot use 0 as a literal value e i cannot cast it to my type. ... |
33. Custom UserType for id forum.hibernate.orgI searched High and Low and cannot get a definitive answer, so hopefully someone can help me here. This is my Hibernate mapping: |
34. Custom NULL value for objects in legacy database forum.hibernate.orgHi, I am working with legacy database. When one object is referencing other, i.e. in @ManyToOne relation, value -1 means that reference to other object is NULL (by default Hibernate is expecting NULL). Obviously when I try to load such object using Hibernate I am getting error that object with id -1 does not exist. also, when I save such object ... |
35. Custom UserType forum.hibernate.orgWhy Custom user type requires a public default constructor ? org.hibernate.type.CustomType instantiates the Custom User Type which required the default constructor of the custom user type to be public. It should have been allowed to have private default constructor in the custom user type and that could have still be instantiated by the hibernate using the following code; Constructor> constructor = ... |
36. Custom String ids won't update on merge forum.hibernate.orgProblem description: My classes that use a Long key that are generated from an oracle sequence work just fine. I can execute saveOrUpdate and it will know when to do an update or an insert. For some of my small classes that are only String Code/String Description, where the code is the @Id, Hibernate seems to be unable to determine that ... |