entity 3 « JPA « Spring Q&A





1. Single persistence unit with entities in multiple JARs    forum.springsource.org

Single persistence unit with entities in multiple JARs I have an application comprised of multiple modules, each building as a separate JAR and each with its own set of persistent entities. ...

2. Spring managed JPA entity listener    forum.springsource.org

Hi, Is there a way I can register a spring managed entity listener with my jpa provider when using the spring jpa support. I have had a look and nothing pops ...

3. Entity Proxy with Inner Field Entity implementation Problem    forum.springsource.org

I have dependencies between entities that is StepField Entity depends on Field Entity, and this have the following spring XML snippet Code: Code:

10. An Entity class problem HUGE    forum.springsource.org

An Entity class problem HUGE Well, I have an entity class which has Boolean (big B) properties. when i persist it (with the properties/fields set via the setter methods) the properties ...

11. Using both event listeners and an entity interceptor    forum.springsource.org

Using both event listeners and an entity interceptor Hi Is it possible to use both event listeners and an entity interceptor in a hibernate session factory? The hibernate documentation indicates that ...

12. Hibernate+Spring: Issue in Pre&Post Update entity listeners    forum.springsource.org

Oct 14th, 2008, 02:19 PM #1 imsathya View Profile View Forum Posts Private Message Junior Member Join Date Jul 2006 Posts 14 Hibernate+Spring: Issue in Pre&Post Update entity listeners Hi, We ...

13. entity manager problem with threading    forum.springsource.org

entity manager problem with threading Hi! Consider the following code: Code: public class Worker { private static final AbstractApplicationContext context; static { context = new ClassPathXmlApplicationContext("META-INF/context.xml"); context.registerShutdownHook(); } public static final ...

14. [JPA] entities in different jars    forum.springsource.org

[JPA] entities in different jars Hi, I have a simple multi-maven-project - 2 jars each with a few JPA-entities and providing a single persistence.xml in each jar, listing the entity classes. ...

15. Mangled special character entities in StaxStreamPayloadEndpoint response    forum.springsource.org

Mangled special character entities in StaxStreamPayloadEndpoint response Hi, I ran into a strange issue. In an AbstractStaxStreamPayloadEndpoint subclass, I need to include some properly 'escaped' special character xml entities in the ...

16. Hibernate entity autodetection and persistence.xml    forum.springsource.org

Hi! I've noticed that when I configured spring with Hibernate and configured it to autodetect the entities it will only scan the path where the META-INF/persistence.xml is. This is, if the ...





17. Disabling schema update for a signle hibernate entity    forum.springsource.org

Disabling schema update for a signle hibernate entity I'm using an Oracle database with a table that my application has a read-only access to. I have configured a hibernate entity class ...

18. hibernate entity with @org.hibernate.annotations.Entity(mutable=false)    forum.springsource.org

I am trying to understand when I want hibernate to do read-only or no updates for an entity in this case I remove the all the set methods and must provide ...

19. Native sql - creating entity from results    forum.springsource.org

I am using spring 2.5 and hibernate 3.0. In spring I am usiung HibernateDaoSupport. Can you please give me the sample code to access the database, write db native sql query, ...

20. Entity not mapped - easy question?    forum.springsource.org

Entity not mapped - easy question? Hi - I am new to Spring XA transactions. My app requires access to 2 different databases so I changed my transactionManager to use JTA ...

22. how to find if an entity is detached or persistent    forum.springsource.org

Originally Posted by miroconnect@yahoo.com Is there away to find if and entity is detached or persistent in hibernate ? SOME BODY PLEASE HELP ME WITH THIS I have item and bids ...

23. Detached entity exception - even after a merge() ?    forum.springsource.org

Detached entity exception - even after a merge() ? Hi folks, This has got me stumped. I have a persistent object saved in the Web session that needs to be updated ...

24. Hibernate - Spring : Unknow Entity    forum.springsource.org

Mar 23rd, 2009, 05:56 AM #1 cmoulliard View Profile View Forum Posts Private Message Member Join Date Jan 2008 Posts 48 Hibernate - Spring : Unknow Entity Hi, I have a ...

25. Timestamp all entities that are updated during a unit of work    forum.springsource.org

Timestamping a single entity is pretty simple by using a hibernate/JPA interceptor to set the update timestamp. I have a special usecase where all entities that get updated within the same ...

26. ClassCastException - Entity cannot be cast as Entity    forum.springsource.org

ClassCastException - Entity cannot be cast as Entity I'm pretty sure I'm missing something obvious here so hopefully somebody can correct me :-) I'm playing around with some Spring + JPA ...

27. XML document structures must start and end within the same entity    forum.springsource.org

XML document structures must start and end within the same entity Hello, I am using Spring-batch 1.1.4 RELEASE and I have stumbled across an error while parsing a XML file with ...

28. Spring DM and Eclipselink entity weaving not working.    forum.springsource.org

Spring DM and Eclipselink entity weaving not working. Hi, I have been searching for the helpful posts for the issue I have related to spring dm and eclipslink entity weaving but ...

29. Packaging entities classes in a separated jar    forum.springsource.org

May 7th, 2009, 12:26 PM #1 tobiasThor View Profile View Forum Posts Private Message Junior Member Join Date Dec 2008 Posts 3 Packaging entities classes in a separated jar I have ...

30. Newbie: Hibernate Entity Manager problem    forum.springsource.org

Newbie: Hibernate Entity Manager problem I'm trying to use JPA with hibernate entity manager in my application, but every time I invoke any method on an entity manager bean, I get ...

31. Slow startup - JPA entities initialistaion running twice    forum.springsource.org

May 13th, 2009, 11:43 AM #1 lost_in_space View Profile View Forum Posts Private Message Junior Member Join Date Aug 2008 Posts 12 Slow startup - JPA entities initialistaion running twice My ...

32. additional methods in hibernate entity    forum.springsource.org

I added couple of additional methods in my entity pojo , just to avoid repeating same code everywhere ,like Code: public void removeProperty(PropertyVariable propertyVariable){ WFProperty wfProperty= getWfProperties().get(propertyVariable); if(wfProperty!=null){ getWfProperties().remove(propertyVariable); } } ...

33. No identifier specified for entity    forum.springsource.org

No identifier specified for entity hi, I use spring 2.5.5 with hibernate jars that come with the distribution and java 1.5_18 I WANT to use annotations : Code: import java.util.List; import ...

34. Timestamp Field as Entity Version    forum.springsource.org

Timestamp Field as Entity Version I have created an entity using "new persistent class jpa", I then modified the entity to use a last updated field as the version by adding ...

35. getJpaTemplate().persist(entity)    forum.springsource.org

getJpaTemplate().persist(entity) Greetings, I am new to JPA. I have a DAO: public class UserDAO extends JpaDaoSupport implements IUserDAO { inside, there is a method, save: public void save(User entity) { logger.info("saving ...

36. Help needed! Hibernate operation: could not load an entity    forum.springsource.org

Jun 18th, 2009, 04:21 AM #1 bornleo26 View Profile View Forum Posts Private Message Visit Homepage Senior Member Join Date Jul 2007 Location Faridabad India Posts 138 Help needed! Hibernate operation: ...

37. using -entity at add field    forum.springsource.org

using -entity at add field hey all, i am having some problems with adding fields to entities that were created earlier, am trying to use the -entity switch as Ben described ...

38. Thoughts on how to use Aspects for Audit requirement on Domain Entities.    forum.springsource.org

Jun 27th, 2009, 05:39 PM #1 marcioemiranda View Profile View Forum Posts Private Message Junior Member Join Date Jun 2009 Posts 7 Thoughts on how to use Aspects for Audit requirement ...

39. update multiple objects of same entity as one operation    forum.springsource.org

I have a requirement that need to update multiple objects of same entity as part of one operation. I am currently doing iterartion and merge each object. Code: for (Employee obj: ...

40. HibernateSystemException: Unknown entity:    forum.springsource.org

HibernateSystemException: Unknown entity: Hi All, I am getting the following error Caused by: org.hibernate.MappingException: Unknown entity: com.xxx.w2refapp.vo.Event at org.hibernate.impl.SessionFactoryImpl.getEntityPer sister(SessionFactoryImpl.java:548) at org.hibernate.impl.SessionImpl.getEntityPersister( SessionImpl.java:1338) at org.hibernate.event.def.AbstractSaveEventListener. saveWithGeneratedId(AbstractSaveEventListener.java :96) at org.hibernate.event.def.DefaultSaveOrUpdateEventLi stener.saveWithGeneratedOrRequestedId(DefaultSaveO rUpdateEventListener.java:186) ...

41. IllegalArgumentException: Unknown entity    forum.springsource.org

IllegalArgumentException: Unknown entity I am trying to get started with JPA + Spring, but running into an issue. I have a simple TestNG test which tries to persist an entity, but ...

42. Spring DM and JPA/Hibernate - Finding Entities    forum.springsource.org

Jul 27th, 2009, 04:57 PM #1 cloutierm View Profile View Forum Posts Private Message Junior Member Join Date Jul 2008 Posts 19 Spring DM and JPA/Hibernate - Finding Entities I am ...

43. exception : detached entity passed to persist    forum.springsource.org

Aug 1st, 2009, 01:16 PM #1 ewawong View Profile View Forum Posts Private Message Junior Member Join Date Oct 2008 Posts 23 exception : detached entity passed to persist Hi guys, ...

44. eclipseLink doesn't like transient entity manager    forum.springsource.org

eclipseLink doesn't like transient entity manager I am using Roo M2....set up a project and installed a jpa like so: install jpa -provider ECLIPSELINK -dataBase MYSQL then, ran "mvn test" and ...

45. Entity unknown    forum.springsource.org

Aug 19th, 2009, 04:51 AM #1 Trollchik View Profile View Forum Posts Private Message Junior Member Join Date May 2009 Posts 12 Entity unknown Hello, I'm new in Spring. I try ...

46. Problem creating an Entity Manager Factory    forum.springsource.org

Problem creating an Entity Manager Factory Hey guys Im trying to integrate hibernate + annotations into my Spring MVC project, but I keep getting this exception "WebModule[/House]PWC1275: Exception sending context initialized ...

47. HTML entities problem for I18n    forum.springsource.org

HTML entities problem for I18n Hi everyone, I'm developping an application with spring 2,5. I use some application-resources-property files for I18n. So in french and german I got some accents in ...

48. call save on an already persistent entity    forum.springsource.org

call save on an already persistent entity I have a class like this (with getters and setters, all mapped to hibernate, each with a sequence to oracle DB) public class A{ ...

49. How do you annotate jpa fields in super classes that are not @Entity?    forum.springsource.org

How do you annotate jpa fields in super classes that are not @Entity? How do you map fields in a super classs (like a DomainObject base class that all entities share) ...

50. Spring 2.5 & Hibernate Entity manager not setting identity    forum.springsource.org

Spring 2.5 & Hibernate Entity manager not setting identity I'm writing an app with spring 2.5, Hibernate Entity manager, tomcat 6 and mysql 5. Have no problem getting everything integrated. The ...

51. JPA Entity hashcode & equal method    forum.springsource.org

I am new to JPA with spring. It is always necessary to override the methods hashcode and equals when create an entity bean. If it is true, could you explain the ...

52. Numeric Entity handling with XmlOptions    forum.springsource.org

Numeric Entity handling with XmlOptions Hi there, I'm having a tricky time trying to transform a British pound symbol () in my XML to a "numeric entity" - i.e. & # ...

53. Entities removed from database after commit still available via query    forum.springsource.org

Entities removed from database after commit still available via query Hello, here's the set-up: * I'm using JPA, Spring's JPA Support Daos, the LocalContainerEntityManagerFactoryBean, transactions are configured via annotations. * All ...

54. RC2: org.hibernate.AnnotationException: No identifier specified for entity    forum.springsource.org

RC2: org.hibernate.AnnotationException: No identifier specified for entity I use the new RC2 and if i run a demo app with only one persistent class i get the following exception: Code: Caused ...

55. How to populate the id of a newly created entity?    forum.springsource.org

How to populate the id of a newly created entity? Hello Forum, I have a bidirectional 1:N relationship between two entities Formula and FormulaInputValue. Formula has therefore a member variable of ...

56. Autodetect Hibernate Entity Class    forum.springsource.org

In the web app that I created, I am trying to use Hibernate entity classes that are packaged in a jar. When I try to use these classes, I get the ...

57. Where to put business needs not related to specific entities?    forum.springsource.org

Hi Ben, where would you suggest putting business methods not related to one specific entity, especially when also hitting the persistance layer? In detail, would you introduce a new business layer ...

58. org.hibernate.MappingException: Unknown entity: (With Annotated Entities)    forum.springsource.org

Oct 19th, 2009, 02:27 PM #1 jr_arzuaga View Profile View Forum Posts Private Message Junior Member Join Date Oct 2009 Posts 16 org.hibernate.MappingException: Unknown entity: (With Annotated Entities) Hi, I have ...

59. 'String index out of range: -1' error when creating a new entity    forum.springsource.org

'String index out of range: -1' error when creating a new entity Hi. Does anybody know how to create entities with BO in the end? I want to create a new ...

60. Problem with creating an entity    forum.springsource.org

Hi, I'm new to Roo and I have a lot of questions. I have a simple entity Code: import javax.persistence.Entity; import org.springframework.roo.addon.javabean.RooJavaBean; import org.springframework.roo.addon.tostring.RooToString; import org.springframework.roo.addon.entity.RooEntity; import javax.persistence.Table; @Entity @RooJavaBean @RooToString ...

61. Entity factory fails with multi module maven build    forum.springsource.org

Entity factory fails with multi module maven build I have two modules, a common module and a persistence module (which depends on the common module) in my maven build, both of ...

62. Hibernate + JPA + Spring: detached entity passed to persist    forum.springsource.org

Hibernate + JPA + Spring: detached entity passed to persist I am using spring, hibernate and JPA for my data access layer. I am getting the following exception when try to ...

63. "Select Entity" instruction not clear in field create?    forum.springsource.org

"Select Entity" instruction not clear in field create? Hello! I'm working through building a Roo project, using only the hints to guide me. By and large this is working out OK, ...

64. Spring + Glassfish + JPA - Could not persist a new entity    forum.springsource.org

Spring + Glassfish + JPA - Could not persist a new entity Hi all, I have an environment where I use Spring, JPA (Hibernate as the provider) and Glassfish. I managed ...

65. Using @Configurable with entities and @MappedSuperclass    forum.springsource.org

Nov 16th, 2009, 11:47 AM #1 raul.arabaolaza View Profile View Forum Posts Private Message Member Join Date Jul 2007 Posts 88 Using @Configurable with entities and @MappedSuperclass Hi, I want to ...

66. Versioning of entities results in multiple entries    forum.springsource.org

I got multiple entries when adding fields to a specific table and doing updates. ROO version: RC3 Database: MySQL 5.1 mode: update Are there any issues for this topic already? Cheers ...

67. multiple entities within a controller    forum.springsource.org

Hi all I have a table customer with some attributes Links to another table Activity with a fk linkinng them How do i create a controller for entering in data for ...

68. AOP on Hibernate loaded entities    forum.springsource.org

AOP on Hibernate loaded entities Hello, I post here something which should have been done before but I do not success to find it on the Net : I have my ...

69. What's the best pratice to create non entity related web controller    forum.springsource.org

What's the best pratice to create non entity formbackbean related web controller in Roo? I want to create web controller, jspx, non entity formbackingbean, etc... thanks Bin

70. Entity field with --notNull --sizeMax    forum.springsource.org

Hi all, I am adding a field "description" with the parameters "--notNull --sizeMax 4096" to an entity "License". When running the generated web application, I manage to create a License without ...

71. entity field with reference    forum.springsource.org

entity field with reference Hi all, I have the following code: HTML Code: entity --class ~.core.License field string --fieldName name --notNull field string --fieldName description --notNull --sizeMax 4096 controller scaffold ~.web.LicenseController ...

72. Making entity pages search engine friendly    forum.springsource.org

Making entity pages search engine friendly Hello, Looking at the show page, I noticed that the page doesn't populate the metadata correctly. This means that a search engine will index each ...

73. InvalidDataAccessApiUsageException: detached entity passed    forum.springsource.org

Hello, This method using hibernatetemplate by spring public void enable(Long id) { Spedizione spedizione = (Spedizione)this.getHibernateTemplate().get(Spediz ione.class, id); this.getHibernateTemplate().merge(spedizione); } always return org.springframework.dao.InvalidDataAccessApiUsageE xception: detached entity passed to persist: Spedizione; Is ...

74. Ovewriting toString() in entity deletes all *.aj    forum.springsource.org

Ovewriting toString() in entity deletes all *.aj First of all, Which is the right word "overwrite" or "override"? (Please don't reply that override is a method of java.util.horse) In the meantime ...

75. EM.Merge vs JPQL update for updating an entity    forum.springsource.org

Is there any difference in the approaches of em.merge(obj) vs JPQL update query for updating an entity in the Database? In our application, we encounter OptimisticLockException when using the em.merge approach ...

76. Generated test for entity with a short data typy    forum.springsource.org

I created an entity with --testAutomatically. It has a short-type attr.: Code: @Entity @RooJavaBean @RooToString @RooEntity public class VideoPart { @NotNull private short partId; } The unit test being generated tries ...

77. PizzaShop example and external entities    forum.springsource.org

@RequestMapping(value = "/pizza", method = RequestMethod.POST) public String PizzaController.create(@Valid Pizza pizza, BindingResult result, ModelMap modelMap) { ... pizza.persist(); return "redirect:/pizza/" + pizza.getId(); }

78. Entity changes committed without calling merge    forum.springsource.org

Entity changes committed without calling merge Hello everyone, I'm using JPA, Hibernate 3.3 and Spring 2.5 for Transactions. I'm seeing an issue when I pull an entity inside of a transaction ...

79. switching between entities    forum.springsource.org

switching between entities I was just wondering what you recommend as the best way to switch between entities? Suppose I create a person entity, add a couple fields, then add a ...

80. Multiple entity controller needed    forum.springsource.org

Multiple entity controller needed Hi all I have a customer entity I have an activity entity They both share a key pack_id I wish to create a single screen for entering ...

81. version field added to entities    forum.springsource.org

It's for optimistic locking. If you attempt to commit some changes to an entity but it turns out someone else has updated that entity in the meantime (as indicated by the ...

82. Generated entity's show.jspx escapes xhtml fields    forum.springsource.org

Generated entity's show.jspx escapes xhtml fields This may not be a roo specific issue, but I've developed our current codebase with the same technologies as roo and not had this issue. ...

83. Creating schema from entities    forum.springsource.org

Creating schema from entities How do we create a schema, or reset the database, from the entities created in roo? It seems when I run "perform tests" it creates a schema ...

84. Manual (Non-@GeneratedValue) Entity identifiers are excluded from the create.jspx    forum.springsource.org

Manual (Non-@GeneratedValue) Entity identifiers are excluded from the create.jspx By default Roo excludes the entity @Id fields from the create.jspx and update.jspx views. While expected for the automatically generated identifiers this ...

85. Accessing entity IDs generically    forum.springsource.org

Hi Andrew You have a few options: Manually edit the .java file to extend a common superclass that declares the identifer you want, plus an accessor and mutator (ie no longer ...

86. Read-only Entity(s)?    forum.springsource.org

I've looked around a bit but haven't seen anyone else asking about this. If I have read-only access to existing tables (in my case HR data), there doesn't seem to be ...

87. Returning 404 when entities are not found    forum.springsource.org

Hello, Currently when one requests an entity that doesn't exist, a normal page is generated stating the entity wasn't found. On the other hand, if any other resource is requested from ...

88. advanced entities relation?    forum.springsource.org

advanced entities relation? Hi. I use hibernate 3. I need to build quite complicated relation. It's many-to-many relation with type of it described. So it gives information not only whether this ...

89. Reference to entities on     forum.springsource.org

Reference to entities on Hi, I've been stuck on this for a while, so perhaps you could point me in the right direction. Say you have a blog application with ...

90. Entity IDs are hackable by default    forum.springsource.org

The default behaviour of Roo-generated entity controllers for an update (PUT) request is to read the entity ID from the "id" request parameter. This is a potential security flaw, as a ...

91. checking if entity with id exists    forum.springsource.org

Hello, I've been using Roo for the past few weeks, however have pretty long Hibernate history. I am using findById method on an entity and if the entity doesn't exist an ...

92. shouldn't the generated merge() method return the re-attached entity?    forum.springsource.org

Hi! Roo generates the following merge() method in MyEntity_Roo_Entity.aj: Code: public void MyEntity.merge() { if (this.entityManager == null) this.entityManager = entityManager(); MyEntity merged = this.entityManager.merge(this); this.entityManager.flush(); this.id = merged.getId(); } Why ...

93. Consequences of pushing _Entity*_aj logic into .java file.    forum.springsource.org

Hi, We would like to reuse the persistence logic of an entity generated by roo. What is the best way of doing that other than pushing it from .aj to . ...

94. spring hibernat with jpa:No identifier specified for entity    forum.springsource.org

spring hibernat with jpa:No identifier specified for entity hi I am new to spring and hibernate an I apologize for my bad english. When I start my development server this error ...

95. JPA Entities from Existing Database    forum.springsource.org

JPA Entities from Existing Database Good Folk, In http://static.springsource.org/sprin...sting-database "5.2. Existing Databases", I read with interest: In the meantime, we recommend you use your preferred JPA provider's tool for introspecting a ...

96. Find bringing PK object instead Entity object    forum.springsource.org

@Entity @Table(name = "SUBSCRIPTION") public class Subscription implements Serializable { private static final long serialVersionUID = -2290713792736331110L; @EmbeddedId protected SubscriptionPK subscriptionPK; ... }

97. "Test" in entity names    forum.springsource.org

Hi, I'm just trying out Roo by building a small app for managing (manual) test cases. Unfortunately, Roo seems to reject all entity names that have "test" in their names, regardless ...

98. JPA,Spring 3 and how to persist "3rd party packages" - entities?    forum.springsource.org

JPA,Spring 3 and how to persist "3rd party packages" - entities? Hello, I'm new to Spring. I've set up the complete config for jpa/hibernate + postgresql + spring 3 with maven. ...

99. Read-only Entity(s)?    forum.springsource.org

Read-only Entity(s)? Read-only Entity(s)? Was this fixed in 1.0.2? There is another thread on this saying it was going to get fixed in 1.0.2, however theres nothing I can see in ...

100. rename an entity    forum.springsource.org

What is the easiest way to rename an entity class after it is created in roo? I tried using eclipse refactor, but it left quite a few things for me to ...