hibernate-tools

Generate JSF2 CRUD's - Can I create the bean and xhtml automatically for any entity?

吃可爱长大的小学妹 提交于 2019-12-14 03:33:24
问题 I'm looking for any kind of software which allows me to generate, in an automatically way, the MVC files (a bean and a xhtml view) of any CRUD of any entity using Java Server Faces 2 and Richfaces 4 technologies. I think one solution would be to use the Hibernate Tools plugin for Eclipse, creating an exporter like the Dao code generator but I don't know if it is possible or how can i do that. I search but I didn't find any documentation about it. Do you know which is the best solution for

Reverse Engineering with Hibernate Tools in Eclipse Indigo

谁说我不能喝 提交于 2019-12-13 04:20:06
问题 I use Eclipse Indigo with plugin Hibernate Tools (JBoss by red hat) for database connection I use Microsoft SQL Server 2008 JDBC Driver. When I try to use Reverse Engineering tool (hibernate code generation configuration tool) to generate class based on database table, instead of "string" type fields I get "Serializable" type fields. import java.io.Serializable; /** * Customers generated by hbm2java */ public class Customers implements java.io.Serializable { private Serializable customerId;

Hibernate Tools failing to get index info from Postgres tables

一笑奈何 提交于 2019-12-11 11:24:45
问题 I'm using Hibernate Tools with Ant to generate POJOs from a Postgres database. My database has two simple tables: Person and Vehicle. Each table has two columns: an id and a name When the Person POJO is being generated, Hibernate throws an exception when attempting to obtain index info: [hibernatetool] getIndexInfo(null.public.person) [hibernatetool] Exception while trying to get indexinfo on public.person=Exception while getting index info for public.person Despite this exception the Person

HibernateTemplate Update Query

久未见 提交于 2019-12-10 20:08:18
问题 How to use hql update query using hibernate template thi is the hql statement "update Login set empSmartId = 48750005" +" where empPassword = 6328ef1675ddb7106eba8dc2661961d7" using getHibernatetemplate() Current code: public class LoginDaoImp extends HibernateDaoSupport implements LoginDao { public boolean resetAttempt(Login login) { try { login.setAttempt(0); getHibernateTemplate().update(login); return true; } catch (Exception e) { e.printStackTrace(); } return false; } i can save whole

Eclipse hibernate pojo generation include foreign keys

对着背影说爱祢 提交于 2019-12-10 15:43:21
问题 I have been following an excellent guide for generating pojos from a mysql database using hibernate. One can find the guide here for reference: Generate pojos with hibernate I am getting pojos which have fields that embed other objects when a foreign key was present. For example, user's have addresses. Hibernate is generating something like the following: public class User(){ private String name; private Integer uid; private Address address; } I have a problem, though, in that I want the

org.hibernate.MappingException: entity class not found ( using qualified class name does not work)

故事扮演 提交于 2019-12-10 09:43:50
问题 I'm trying to run a simple SELECT FROM table ( I have also tried SELECT FROM package.Class )query but I keep getting this error : org.hibernate.MappingException: entity class not found: demo.Agents at org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:125) at org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactory.java:191) at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:67) at org.hibernate.tuple.entity.EntityMetamodel.<init>

How generate DAO with Hibernate Tools in Eclipse?

早过忘川 提交于 2019-12-09 18:33:56
问题 I'm using : Eclipse Java EE IDE Web Developers version:Indigo Release with hibernate tools, i'm new to hibernate in Eclipse, so i learn how configure the hibernate and generate the POJO's with annotations (which i think is better than .xml). So after generate my POJO's and DAO's i try to make a insertion, but launch a 'null point exception' to my entity manager, this is how hibernate tools is generating the dao classes: Trying to use the DAO generated: public static void main(String[] args) {

Hibernate Tools - DAO generation

独自空忆成欢 提交于 2019-12-08 05:44:30
问题 I am using the eclipse hibernate tools plug-in to reverse engineer my database. I spent my whole day looking for how to force the DAO generator to use HQL/Criteria with the session factory, transaction, etc. Right now, if I have the table TABLE in my database, I obtain the DAO class TableHome. This class uses the persistence EntityManager. I found tutorials using an older version of hibernate tools generating TableDAO instead, and this is what I exactly need. Thank you very much. 回答1: Whether

PersistenceException: No persistence provider found for schema generation for persistence-unit named default

若如初见. 提交于 2019-12-07 05:13:33
问题 I have tried to set up a gradle task that runs a java main class that is intended to generate a SQL schema. I have no persistence.xml configuration file. Here is my configuration and code: My gradle task: task JpaSchemaExport(type: JavaExec){ description "Exports Jpa schema" dependsOn compileJava main = "com.bignibou.tools.jpa.JpaSchemaExport" classpath = sourceSets.main.runtimeClasspath + configurations.compile } My export utility: public class JpaSchemaExport { public static void main

Hibernate Tools - DAO generation

这一生的挚爱 提交于 2019-12-06 14:39:55
I am using the eclipse hibernate tools plug-in to reverse engineer my database. I spent my whole day looking for how to force the DAO generator to use HQL/Criteria with the session factory, transaction, etc. Right now, if I have the table TABLE in my database, I obtain the DAO class TableHome. This class uses the persistence EntityManager. I found tutorials using an older version of hibernate tools generating TableDAO instead, and this is what I exactly need. Thank you very much. Whether you're using Eclipse or not is unclear but if you are, maybe check if the Console Configuration used by the