mysql « Data Type « JPA Q&A





1. Can I make Hibernate transparently avoid string duplication in the database?    stackoverflow.com

I have a Java program that uses Hibernate and MySQL to store a lot of tracing data about the use of the Eclipse IDE. This data contains a lot of strings ...

2. how to read my blob column from mysql to string type in hibernate    stackoverflow.com

how to read my blob column from mysql to string type in hibernate I have try this way but alway return me: [B@196f4b5

     Article article2=f.daoArticle.findById(article.getSrcUrl());

     ...

3. MySQL enum with hibernate    stackoverflow.com

I have a database table using an enum. This is already working with hibernate (using XML), and I'm trying to convert it to annotations as this is one of the ...

4. How to work with zero dates ("0000-00-00") in Hibernate?    stackoverflow.com

I have MySql table that has a date field with zeroes ("0000-00-00") as its default value (field cannot be null, I can't change table structure). Hibernate doesn't like zero dates and ...

5. Glassfish hangs when serving multiple blob-images from an imageservlet    stackoverflow.com

In my JSP/HTML files i use the following servlet to get blob-images from the MySQL-database.

<img src="/image?id=1" />

Image servlet

This is mapped to a imageservlet, who:
- gets a stateless session-bean injected
- uses the ...

6. With a created by timestamp, is it better to have the DB manage it, or the application?    stackoverflow.com

We have your bog standard Java app under development, and a lot of the records we're creating (Hibernate entities in MySQL) have 'created' and 'modified' timestamps on them. Now, me and one ...

7. Hibernate, Null values and nativeSQL    stackoverflow.com

I'm using hibernate with mySQL and I've the following problem: I do a nativeSQL query on a table with, among others, a column that is a character long. This column can ...

8. Problem retrieving Strings from varbinary columns using HIbernate and MySQL    stackoverflow.com

Here's my scenario. I save a bunch of Strings containing asian characters in MySQL using Hibernate. These strings are written in varbinary columns. Everything works fine during the saving operation. The ...

9. Problem of accent between MySQL and Java application    stackoverflow.com

i have an application with use Hibernate and Mysql. In Mysql i have a blob in my table. When i record a value in this table with accent like é or è ...





10. Time not entered in mysql ? Java    stackoverflow.com

I have a datetime field in mysql table and i am using JPA for persisting data but only date goes in database. Time always shows 00:00:00. What should i do? I am ...

11. Hibernate HQL NULL comparison pattern    stackoverflow.com

Imagine a simple web page allowing you to search Bookings like this: picture of web page

  • If the Booking Number field is not populated I want to return all rows.
  • If the ...

12. Null pointer execption    stackoverflow.com

i am facing null pointer exception in hibernate: org.hibernate.dialect.function.CastFunction.render(CastFunction.java:11) hibernate code is: ("Select date_format(str_to_date(form.dobDate,'%Y%m%d'),'%M (%Y)') as Month");

13. Why Does this JPA enum not work?    stackoverflow.com

It is storing an integer in the database not the string as I requested. Here is the class that contains the enum.

@Entity
@Inheritance(strategy=InheritanceType.JOINED)
public abstract class Document extends BaseModel {

    private ...

14. JPA TemporalType.Date giving wrong date    stackoverflow.com

I have a class that has a date field representing a "valid from" date for a piece of data. It is defined like this:

@Temporal( TemporalType.DATE )
private Date validFrom;
All seems to be ...

15. how to add one day to sql date?    stackoverflow.com

i wanto get the trip which is happened between contractStartdate and contractEndDate+1day. but this following code gives me error.

def tripsForThisContract =  Trip.executeQuery("From Trip where contract_id = ? AND startDate ...

16. Problem retrieving utf-8 string from mysql using hibernate3    stackoverflow.com

When I try to load an object( a row ) from mysql database, the string properties are not loaded properly , and as a result when I print them, nothing is ...





17. Replacing null values of MYsql    forum.hibernate.org

Hi Guys, I am new to hibernate. I have a query which goes like this now _usermaster.emailid can be null in database. All i want is if its null then i want it to return varchar type '' How can ...

18. MySql Date problem    forum.hibernate.org

I have a mapping to a date column in a MySQL DB. I am submitting a form using struts 2 and every time I try to update the object in the DB I get this error : ognl.OgnlException: source is null for getProperty(null, "employee") at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1638) at ognl.ASTProperty.getValueBody(ASTProperty.java:92) at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170) at ognl.SimpleNode.getValue(SimpleNode.java:210) at ognl.ASTChain.setValueBody(ASTChain.java:168) The date in the struts 2 form ...

19. Using Mysql set datatype in hibernate.    forum.hibernate.org

20. Hibernate 3.6 and MySQL blobs    forum.hibernate.org

Hi, We have an application, that was working well using Hibernate 3.5.6. After we updated to Hibernate 3.6.0 we have problems with the MySQL version. After the update we have problems when we write blobs. We get an exception that some characters are invalid: Code: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your ...

21. Multibyte strings, Hibernate, MySQL and MSSQL    forum.hibernate.org

Hi, We have an application that needs to support multibyte strings (japanese characters, chinese characters, etc). We use Hibernate with JPA annotations to create the tables in our database, so no mapping files at all. We support MSSQL and MySQL. I have two questions: 1.) How do I tell Hibernate via annotations that I need a certain field in my class ...

22. Setting up Hibernate with MySQL and JBOSS 7 forst time.    forum.hibernate.org

Hi, I have setup my mysql datasource in standalone.xml and deployed the mysql driver. I am looking at a sample app from the jboss getting started site which uses hibernate and an in memory data source. Here is the persistence.xml from the sample... Code: 02.

23. MySQL+Hibernate- how to create/store a blob    forum.hibernate.org

Hi, I wantto store an uploaded image in the DB as a BLOB. The image data comes as org.apache.struts.upload.FormFile. In my presistance class I have a property of type java.sql.Blob mappd to blob in DB. So, what do I need to do in order to store the image? I can get byte array from the form file. But which Blob to ...

24. Date/Timestamp issue with MySQL    forum.hibernate.org

I have looked through the old forum and the new and not found the answer to this problem (at least not one that worked) so if I am repeating an old question please know that I tried to find it. I am using mysql 4.1 and hibernate 2.1 and I am trying to get effective dating on my objects by having ...

25. problems writing a blob to mysql    forum.hibernate.org

26. Blobs and MySQL DB    forum.hibernate.org

27. mysql, java, hibernate date issue    forum.hibernate.org

I am not sure if anyone in this forum will be able to help or not, but here goes. I created an application that uses a MySQL database, JSTL (EL), Struts and Hibernate. I have several fields that require dates to be input into the database. Java uses a 0 based date system (Jan-Dec = 0-11) and MySQL uses a 1 ...

28. mysql/hibernate date problem (3905 vs 2005)    forum.hibernate.org

I am using hibernate 2.1.4 and mysql 4.1.0 I have a java class(POJO) that hibernate persists to the database. The POJO contains a java.util.Date field. If I set the java.util.Date field on the POJO and do System.out.println on it I get Fri Jan 07 00:00:00 GMT 2005 Then if I persist the POJO using hibernate and then later refresh the POJO ...

29. OutOfMemory when using a BLOB with mysql    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.0.2 Mapping documents: