I can not figure out how to set the initial value for the @GenerateValue @Id. I have tried using GenerationType.SEQUENCE but that is not allowed in MySQL. How can I set the initial value to be used for the @GenerateValue? Using both AUTO and TABLE I can still not get the initial value to start at anything but 1 Thank
Tag: mysql
The server time zone value ‘AEST’ is unrecognized or represents more than one time zone
I’m trying to setup a simple hibernate application, when I run it I get a stack trace full of errors. I have the following maven dependencies in my pom.xml file: And the mysql version I’m running locally is: I’m running, what seems, a very simple method, and still getting errors: After the above is executed, I get a long stack
java.lang.IllegalArgumentException: Result Maps collection already contains value for
Hey I’m using Mybatis with Spring Annotations. and getting this error: here is the domain class (sans getters and setters): here is my Mapper.Java class lastly here is the Mapper.xml I’m inclined to believe there is something wrong with the xml select statement. Probably with how I am using foreach. I have another mapper using a similar format it just
JDBI’s @BindBean doesn’t find named parameters in bean class during INSERT
I am consistently getting the following exception below when inserting values using JDBI’s @BindBean into my Mysql database within Dropwizard. The problem seems to be that JDBI is unable to find the properties in the bean. I already isolated the issue into a separate project, but can’t figure out where this is going wrong. I would be very grateful for
org.hibernate.exception.SQLGrammarException: could not insert
Hi i am trying to insert new row in table using hibernate with bean class i am getting exception i am using below mentioned code: hbm file: Action class: Dao class Execption Caused by: where I’m wrong in this code? Answer Mapping database column types to Java types performed by Hibernate mapping configuration that uses Java types. The missing </property>
Error when try to persist entity with Hibernate (MappingException: Unknown entity)
I’m using Hibernate 5.0.6 and Hibernate annotations 3.5.6-Final with MySql 5.1.37 in a standalone maven java application. I’m trying to make a simply persistence example work but I receive the following error when I call save: The classes Is pointed via mapping class in the configuration file. But it is unable to find. But when I do this in HibernateUtil:
Java async MySQL queries
First of all, I don’t have much experience with thread safe programming. I have a MySQL class, and I want to use one instance in multiple threads to prevent blocking code in the main thread. I read about connection pooling but I want to keep it as simple as it is. This is my MySQL class: Is it possible to
Java sorting is not the same with MySQL sorting
I need to check the sorting in the table and table content is given by MySQL. I’m trying the following: Collections.sort(sorted, String.CASE_INSENSITIVE_ORDER); And get the following result: tes3@test.com test4@test.com test5@test.com test@test.com test_user@mail.com user-og@driver.com And this is what I get from MySQL by query: SELECT ’email’ FROM ‘user’ WHERE 1 ORDER BY ‘user’.’email’ ASC : tes3@test.com test_user@mail.com test@test.com test4@test.com test5@test.com user-og@driver.com
jooq single query with one to many relationship
I have a table experiment and a table tags. There may be many tags for one experiment. schema: Is it possible to create a query with jooq which returns the experiments and the corresponding List of tags? something like Result<Record> where Record is a experimentRecord and a list of Tags, or a map<experimentRecord, List<TagRecord>. I also have a query which
Exception while trying to run java program from maven
I have a small java program that connects to a mysql db and reads data from it. I am able to run it successfully using java -cp but when I try to run it using mvn exec:java I get this exception after the program has finished: Why is this happening and how can I fix this? Here is my code