Search Results

Search found 3046 results on 122 pages for 'hibernate validator'.

Page 17/122 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • How to direct hibernate logger statements in different log files for differnet applications using jb

    - by Milind
    Hi, I am using JBOSS 4.2.2 server to deploy multiple web applications. Each application uses Hibernate and for each application there are saperate log files and saparate appendar. Now for Hibernate logging statements of one application should go in log file of that particular application. Does anybody has idea how to configure log4j.xml file to achieve this? Thanks and regards, Milind

    Read the article

  • Implementing EAV pattern with Hibernate for User -> Settings relationship

    - by Trevor
    I'm trying to setup a simple EAV pattern in my web app using Java/Spring MVC and Hibernate. I can't seem to figure out the magic behind the hibernate XML setup for this scenario. My database table "SETUP" has three columns: user_id (FK) setup_item setup_value The database composite key is made up of user_id | setup_item Here's the Setup.java class: public class Setup implements CommonFormElements, Serializable { private Map data = new HashMap(); private String saveAction; private Integer speciesNamingList; private User user; Logger log = LoggerFactory.getLogger(Setup.class); public String getSaveAction() { return saveAction; } public void setSaveAction(String action) { this.saveAction = action; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } public Integer getSpeciesNamingList() { return speciesNamingList; } public void setSpeciesNamingList(Integer speciesNamingList) { this.speciesNamingList = speciesNamingList; } public Map getData() { return data; } public void setData(Map data) { this.data = data; } } My problem with the Hibernate setup, is that I can't seem to figure out how to map out the fact that a foreign key and the key of a map will construct the composite key of the table... this is due to a lack of experience using Hibernate. Here's my initial attempt at getting this to work: <composite-id> <key-many-to-one foreign-key="id" name="user" column="user_id" class="Business.User"> <meta attribute="use-in-equals">true</meta> </key-many-to-one> </composite-id> <map lazy="false" name="data" table="setup"> <key column="user_id" property-ref="user"/> <composite-map-key class="Command.Setup"> <key-property name="data" column="setup_item" type="string"/> </composite-map-key> <element column="setup_value" not-null="true" type="string"/> </map> Any insight into how to properly map this common scenario would be most appreciated!

    Read the article

  • Spring 2.5 Hibernate 3.5 NamedQuery

    - by EugeneP
    I do not use HibernateTemplate, but work with getCurrentSession() in my DAO. I would like to know how to declare Hibernate named queries in a beans.xml file (I do not use hbm.xml). And maybe Spring has alternative means to declare Hibernate named queries?

    Read the article

  • Zero Downtime with Hibernate

    - by Stephan Schmidt
    What changes to a database (MySQL in this case) does Hibernate survive (data, schema, ...)? I ask this because of zero downtime with Hibernate. Change database, split app servers into two clusters, redeploy the application on one of the clusters and switch application. Thanks Stephan

    Read the article

  • Hibernate - on the stack or on the heap?

    - by Stephano
    As a Java programmer, you usually keep two truths in your pocket: Instance variables and Objects lie on Heap. Local variables and methods lie on the Stack. Now that I use Hibernate in just about everything, I realize I'm not as sure of myself. Are there some good rules of thumb for using hibernate and knowing where your memory lives?

    Read the article

  • Anything similar to Hibernate in PHP?

    - by harigm
    I am a Java programmer and was working on a project using Hibernate and Struts for some time. Now For my new project, I am working on PHP and Mysql (learning PHP). Is there any technology which is similar to Hibernate for PHP? If yes, can anyone give me the link where I can understand and use it? Is there a POJO concept in PHP?

    Read the article

  • Configuring Hibernate logging using Log4j XML config file?

    - by James McMahon
    I haven't been able to find any documentation on how to configure Hibernate's logging using the XML style configuration file for Log4j. Is this even possible or do I have use a properties style configuration file to control Hibernate's logging? If anyone has any information or links to documentation it would appreciated. EDIT: Just to clarify, I am looking for example of the actual XML syntax to control Hibernate. EDIT2: Here is what I have in my XML config file. <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <appender name="console" class="org.apache.log4j.ConsoleAppender"> <param name="Threshold" value="info"/> <param name="Target" value="System.out"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{ABSOLUTE} [%t] %-5p %c{1} - %m%n"/> </layout> </appender> <appender name="rolling-file" class="org.apache.log4j.RollingFileAppender"> <param name="file" value="Program-Name.log"/> <param name="MaxFileSize" value="1000KB"/> <!-- Keep one backup file --> <param name="MaxBackupIndex" value="4"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d [%t] %-5p %l - %m%n"/> </layout> </appender> <root> <priority value ="debug" /> <appender-ref ref="console" /> <appender-ref ref="rolling-file" /> </root> </log4j:configuration> Logging works fine but I am looking for a way to step down and control the hibernate logging in way that separate from my application level logging, as it currently is flooding my logs. I have found examples of using the preference file to do this, I was just wondering how I can do this in a XML file.

    Read the article

  • Tomcat error with Hibernate 3.51 / Java EE 6

    - by DD
    I just upgraded to hibernate 3.51 and I get an error now saying: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval () Z. This only happens with Tomcat not with Jetty. I've checked and I don't have any conflict and this method definitely exists. I have hibernate-jpa-2.0-api-1.0.0.Final.jar on the class path, and dont have any conflicting classes. Any suggestions?

    Read the article

  • How I can use searching by Hibernate with Java

    - by ruby
    Hi All ; I want to make searching on my database with hibernate in Java, how can I do that? Normally when I am using JDBC I wrote this code : String Sql="select * from table1 where id like '"+jTextField1.getText()+"%'"; but I want to do that with hibernate database operation, do I need to use session.load(..) ? Thanks from now...

    Read the article

  • Hibernate HQL with interfaces

    - by Benju
    According to this section of the Hibernate documentation I should be able to query any java class in HQL http://docs.jboss.org/hibernate/core/3.3/reference/en/html/queryhql.html#queryhql-polymorphism Unfortunately when I run this query... "from Transaction trans where trans.envelopeId=:envelopeId" I get the message "Transaction is not mapped [from Transaction trans where trans.envelopeId=:envelopeId]". Transaction is an interface, I have to entity classes that implement it, I want on HQL query to return a Collection of type Transaction.

    Read the article

  • What are the best books for Hibernate & JPA?

    - by Justin Standard
    My team is about to build a new product and we are using Hibernate/JPA as the persistence mechanism. There are other book posts on stackoverflow, but I couldn't find one that matched my needs. My manager will be purchasing books for our team to use as a resource so... What are the best books about Hibernate and JPA? (Please list each book suggestion in a separate answer) (If you already see your book answered, instead of adding it again, just vote it up)

    Read the article

  • hibernate for dynamic table creation

    - by user369316
    i AM A HIBERNATE BEGINNER ,Since i need to create dynamic tables with dynamic fields in them i chose to use hibernate . As far as my understanding , creating tables requires a class with the fields defined in the class . How do i generate the classes dynamically based on the table with the required fields ?

    Read the article

  • Hibernate @DiscriminatorColumn and @DiscriminatorValue issue

    - by user224270
    I have this parent class: @Entity @Inheritance(strategy = InheritanceType.JOINED) @Table(name = "BSEntity") @DiscriminatorColumn(name = "resourceType", discriminatorType = DiscriminatorType.STRING, length = 32) public abstract class BaseEntity { and the subclass @Entity @Table(name = "BSCategory") @DiscriminatorValue("Category") public class CategoryEntity extends BaseEntity { But when I run the program, I get the following error: 2010-06-03 10:13:54,222 [main] WARN (org.hibernate.util.JDBCExceptionReporter:100) - SQL Error: 1364, SQLState: HY000 2010-06-03 10:13:54,222 [main] ERROR (org.hibernate.util.JDBCExceptionReporter:101) - Field 'resourceType' doesn't have a default value Any thoughts? Updated: Database is MySQL. I have also changed inheritance strategy to JOINED instead of SINGLE_TABLE. Help

    Read the article

  • HIbernate query

    - by sarah
    Hi I want to execute a query using hibernate where the requirment is like select * from user where regionname='' that is select all the users from user where region name is some data How to write this in hibernate The below code is giving result appropraitely Criteria crit= HibernateUtil.getSession().createCriteria(User.class); crit.add(Restrictions.eq("regionName", regionName));

    Read the article

  • Unable to instantiate class containing Hibernate code

    - by Steven
    hi, i am developing a plug in which deals with hibernate project.I get some classes which contain Session and Session factory .Then i want to instantiate an object of these classes using reflections which i am not able to do it even after including the hibernate jars in the classpath of my plug in.What is the problem?Help

    Read the article

  • How to check for case sensitive in hibernate criteria

    - by dhiraj
    0 vote down star I have used hibernate to fetch the login information from the mysql database. But the problem is that say for example the user name is 'dhiraj' in the database, now the login is successful by entering the user name, but it is also allowing to enter by taking the user name in uppercase also, e.g., 'DHIRAJ'. I want to restrict it to as it in the database. Can you tell me how to achieve that in hibernate?

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >