bean 3 « Map « JPA Q&A





2. entity bean based on two tables. is this possible?    forum.hibernate.org

hi! i have to reengineer an old legacy application. its database tables were designed in a very bad way without relations. the logic to save consistent data is completely held in the application's code. now to my problem: i have two tables (let's call them t1 and t2) with exactly the same columns. now i want hibernate to merge the tables ...

3. entity bean based on two tables. is this possible?    forum.hibernate.org

hi! i have to reengineer an old legacy application. its database tables were designed in a very bad way without relations. the logic to save consistent data is completely held in the application's code. now to my problem: i have two tables (let's call them t1 and t2) with exactly the same columns. now i want hibernate to merge the tables ...

5. dynamic code and table generation with no beans to map to    forum.hibernate.org

Lo, I've some "simple" and "small" ask :oP Hoping someone could handle 'em. I'm a java developer since much time, I'm working on some projects, and while I'll develop 'em I'll use my libraries to design new table and classes while debugging: no reload time, simply extending, compiling and reloading while working. As i could see hibernate doesn't support change in ...

6. Can query a table, cannot insert a row in EJB session bean    forum.hibernate.org

Author Message khoff999 Post subject: Can query a table, cannot insert a row in EJB session bean Posted: Sat Aug 13, 2005 3:10 pm Newbie Joined: Sat Aug 13, 2005 1:58 pm Posts: 6 Hibernate 3, JBoss 4.0.2, Oracle 10 Hi, I'm a newbie, trying to get Hibernate working. I am deploying a HAR file, accessing Hibernate in a ...

7. one-to-many Nested Beans    forum.hibernate.org

Newbie Joined: Thu Aug 18, 2005 9:12 am Posts: 1 Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hello all, I'm working on a very basic situation but I am having quite a bit of trouble with it. In my project I have a date dimension table that is prepopulated with the dates from now until 20 years later. ...





10. Error occurs when bean with setter of float datatype is used    forum.hibernate.org

If you are using Primitives as attributes, and the database contains a NULL value, Hibernate won't know how to handle this since a Primitive can't represent a NULL value. The BasicPropertyAccessor uses the following code to set property values Code: public void set(Object target, Object value, SessionFactoryImplementor factory) throws HibernateException { try ...

11. Why my bean is so "lazy" ?    forum.hibernate.org

Hi gurus, sorry if I ask again about lazy exceptions, but I read a lot of posts about, and still I didnt find the solution. I have a DAO object that load an object and return it to the ActionForm. In this action if I do: objH.getXXX() I get the lazy exception telling me that thw "owning" session is closed. this ...

12. Working with Hibernate inside a Stateless Session Bean    forum.hibernate.org

Hibernate version:3.1rc3 I am looking for some pointers on using Hibernate inside a Stateless Session Bean. I have written, deployed and tested some code with Hibernate 3.1. I need to expose this through a Session Bean. Is it as easy as something like below... public class MySessionBean ... { // Session call backs that need to be added from the // ...

13. Newbie question: Form bean or normal bean    forum.hibernate.org

I am very new to Hibernate and was shown a few things on how to use it with Struts and mapping to form beans. My question is whether it's not better to use a plain java bean which mirrors the table layout instead of a form bean which could have a completely different set of fields? I was told to use ...

14. Hibernate trhough Session beans    forum.hibernate.org

Newbie Joined: Thu Jan 26, 2006 2:45 pm Posts: 5 Hi, I am a newbie in Hibernate and I have the following situation: I use Hiberante 2.1.7 integrated with JBoss 3.2.3 and we have the problem that, by default, Hibernate loads the objects with all the assosiated objects and that means that for every simple query that is made Hibernate constructs ...

15. Do we Really Need EJBs(Session Beans)    forum.hibernate.org

Hi I need some advice from you.We have a application in which we are Struts and Hibernate.Our management is thinking of adding one more layer(that is EJB) to the application.What i feel is there is no need for EJBs when we already have hibernate.Correct me if iam wrong and advice me what we need to do. Thanks In Advance JD

16. using hibernate with ejb2 session beans    forum.hibernate.org

Can someone please point to some references/sample code for acheiving the following using hibernate ? 1. one time creation of hibernate session factory in the context of app servers. 2. when/how to make hiberbate session use underlying connections/transaction context. I basically want to setup using Hibernate with session beans. (ejb2.x) Thank You.





17. Persistence two beans in the same table    forum.hibernate.org

Hi, Could you be a bit more elaborate ? For starters, is it the case that your table has, say (m + n) columns, and you want to represent it using two different beans having properties corresponding to the m and n columns, respectively ? It would be great if you could provide a little background here, since your requirement seems ...

18. Hibernate in Session bean...    forum.hibernate.org

In session bean i want to use Hibernate....... I have registrerred the SessionFactory with JNDI. But all configuration setting are done in Web app. i.e. hibernate.cfg.xml is in web app Also Thread Local Util Class is there in Web App... In this situation wat i need to do to use hibernate in session bean..??? Can anybody knows the Link of examples ...

19. Select Bean with unique property using Criteria    forum.hibernate.org

Group isn't the same as distinct. If you "select * from cat group by name" in SQL, you'll get an error. You could "select name from cat group by name", or "select sum(age) from cat group by name", but you can't do what you're trying to do. You want "from cat c where (select count(*) from cat group by name) = ...

20. insert a bean with relationship problem!!!    forum.hibernate.org

Hello everybody I am using the version 3.1.2 of hibernate and using MS SQL Server 2000. this project was working on oracle. recently we have replaced it with the hibernate. but I have faced the following problem: I have 2 tables + TBL_Request - ID (PK, numeric) - REQ_TIMESTAMP (timestamp) - CURRENCY_ISO_CODE (numeric) + TBL_CURRENCY - ID (PK, numeric) - ISO_CODE ...

22. Strategy for toString of bean with many Lazy properties?    forum.hibernate.org

I normally like to have toString tell me as much as possible about my objects. With some of my objects, 80% of the properties are lazy. Now my toString is down to just a few basic fields: Code: /** * @see java.lang.Object#toString() */ @Override ...

23. Deploying Hibernate With Ejb3.0 Session Beans    forum.hibernate.org

Hi I am glad if Some one suggest me How to Deploy Hibernate with Ejb Session Beans. I have done with Ejb3 Entity beans.. Stand alone Hibernate perfoms awesome. But Ejb3 performs reallly bad.. So i just want to experiment Ejb3.0 Session beans with Hibernate(As Entity beans).. Please help me out on Directory structure or if possible a small example. Thanks ...

24. Stateless session bean using XDoclet and Hibernate    forum.hibernate.org

General question: If I have a Stateless session bean that uses XDoclet tags and Hibernate to persist objects, would this bean be consider as using BMP? We are using EJB 2.0. Everything I've read seems to indicate that CMP/BMP only apply to Entity beans not Session beans. Session beans being either Stateless or Stateful.

25. entity bean - only xml - no annotation - hibern & ejb3    forum.hibernate.org

I'm not sure what you are wanting to do here. I never use annotations for Hibernate (or anything for that matter) as they are a very bad idea and will tie you to a particular data schema. I use the XML file in the class path. Are you asking to be able to use an XML file that is not in ...

26. hibernate comparison with entity beans    forum.hibernate.org

Can you be more specific? You mean EJB 2 entity beans or EJB 3 entities? Hibernate, as everything else, has limitations. But you usually cannot tell until you face them. For instance, it cannot eagerly fetch more than one bag in a single query as discussed in another topic. As for EJB 2 entity beans, well, I believe can only tell ...

27. cant access hibernate obj in web container from session bean    forum.hibernate.org

I am pretty new to hibernate but I was able to use hibernate objects within EJBs. My problem is that I have a table in the database called Asset, I can access methods in Asset inside of a seession bean but when I return the Asset object to the JSF managed bean and try to access it I get this error ...

28. How to change the properties of a Hibernate bean in NetBeans    forum.hibernate.org

Hi, Does anybody knows how to change the properties of a hibernate bean in NetBeans 5.5 once it is created. For example if i create a Hibernate Bean with some vairalbes and later i want to edit that bean for example i want to change the generator value form "native" to "assigned", but i couldn't do that. Though i changed the ...

29. Hibernate mapping:Bean class & MySQL DB View    forum.hibernate.org

How can i do Hibernate mapping in hibernate mapping file (*.hbm.xml) for Bean class & MySQL DB View ? ie: View is not a base table. How can i map(in the hibernate mapping file *.hbm.xml) view with the Bean ? Can i mention view name as table name here ?

30. Deserializing hibernate session from session bean    forum.hibernate.org

Hibernate version: 3.2.0.cr2 Not sure if this is a JBoss question or a Hibernate question so I'll ask it here. I am running JBoss 4.0.4.GA-Patch1 with Hibernate 3. I have a Stateful session bean which has an injected entitymanager with a persistent context. Everything works as expected between calls to the bean until it is passivated. Once it is passivated, then ...

32. Mapping problem with EJB 3.0 Entity Beans    forum.hibernate.org

Caused by: org.hibernate.hql.ast.QuerySyntaxException: a.package.AnEntity is not mapped [select e.propA, e.propB, e.propC from a.package.AnEntity as e where e.id in (select e.prop.id from a.package.AnotherEntity as ae where ae.prop = :param)] at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:158) at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:87) at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:70) at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:267) at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3049) at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2938) ...

33. Help with running hibernate in EJB session bean    forum.hibernate.org

I created a stateless session bean inside a EJB project. Using RSA 6.0 and hibernate 3.1.3 And the method tries to create a instance of config: Configuration cfg = new Configuration(); Tried to test the session ejb in the test env, with all the hibernate jars in the class path. It bombs, errors are following. Anybody has ideas? It seems like ...

34. identifier of an instance [bean] was altered from     forum.hibernate.org

I am relatively new to Hibernate so I have been trying a VERY simple test, running on Tomcat 5.5. I have a 'project' table in MS SQL Server 2005 which has a project_id primary key. This is an identity column. Other tables reference this column as a foreign key. I created a ProjectBean class which contains this relevant code: Code: ...

35. identifier of an instance [bean] was altered from     forum.hibernate.org

I had posted an item about this a week or so ago: http://forum.hibernate.org/viewtopic.php?t=966245&highlight= In that post, i had a table with an identity key in sql server and a corresponding bean and mapping file. when I would try to save() (or saveOrUpdate() or merge() or persist()), I would get this error: Quote: org.hibernate.HibernateException: identifier of an instance of package.ProjectBean was altered ...

36. acessing mapped beans    forum.hibernate.org

hello, i have two beans which are mapped and have both composite keys. I handle the composite keys with ID-classes handling the composite keys. Now, how can i archieve it to get values from a Bean B (with the methods) by only specifiying the ID for the Bean A (Bean A is 1:1 to Bean B)? e.g BeanA beanA = (BeanA) ...

37. Hibernate failure when inserting data in entity beans    forum.hibernate.org

hai i am running an application for lottery site. in the site i have registration which is a multi step process asking the users profile information ,user id and password hints. after providing all information by the user and clicking the submit buttin inserts all the data into 3 beans at a time. but sometimes the whole hibernate is failing to ...

38. Using Hibernate with Entity Beans    forum.hibernate.org

Hi, We are representing the domain objects as entity beans (BMP) and using Hibernate3 as the persistence mechanism. :-) The entity bean 'Deletegates' to a business object which then uses hibernate persistent objects. e.g. ABCPeristent.java {has all fields to be persisted} ABCBean.java {the enity bean with create, finder, etc} ABCBO.java {the delegate which has all hibernate code for CRUD on ABCPersistent ...

40. websphere 6 + hibernate 3.2.0, CMT beans, leak detected?    forum.hibernate.org

Hi experts, We are using Websphere 6.0.2 application server with Hibernate 3.2.0. I tried simple application scenario where I used one CMT stateless session bean with Hibernate as a DAO layer. I configured everything according to the documentation (CMT, JTA, Websphere6 recommendations), exactly in hibernate.cfg.xml: org.hibernate.transaction.CMTTransactionFactory org.hibernate.transaction.WebSphereExtendedJTATransactionLookup true true I don't use any transactional or session management ...

41. looking for bean in wrong place? why?    forum.hibernate.org

42. Hibernate tries to store beans I wish to have it ignore.how?    forum.hibernate.org

Hi, I have a mapped bean Transaction. I use the same Transaction bean to store summed information retreived from the TRANSACTION table in my mapped class Account. The Account.List in which the Transaction's are kept is not mapped and just serves as a holder which needs NOT to be stored in the database. I find however that for these Transactions which ...

44. Dumb Question - want description not code set in bean    forum.hibernate.org

Hello, This isn't really a problem, I just need to know how to do it. I have tried to search and tried a few things, unfortunately I think the biggest problem I am having is I don't know what I am really looking for to even try to do a good search, I assume this is a simple problem. Situation: Lets ...

46. Merging Java Beans with Hibernate    forum.hibernate.org

I had this problem a while ago and now its here again. I use Java Beans with standard PropertyChangeSupport as my domain objects. As I have a Rich Client all my associations are fetched EAGER. When I call EntityManage.merge() on a detached object hibernate cascades the merge (which is what I want) to the dependend objects. Thereby it calls a setter ...

47. Format Date Object from Hibernate Bean?    forum.hibernate.org

Hello, i have a bean class to read a table from a MSSQL DB. The bean constructs a date field(a). The field seems to be formatted diffrent from a normal Date object. System.out.println(a)=> "2007-09-14 11:32:59.76" from Database Date b = new Date... System.out.println(b)=> "Mon Oct 14 12:20:19 CEST 3907" Both a and b are date objects. I would like to read ...

48. how to map bean class with dynamically generated HTML TRs?    forum.hibernate.org

Hello everybody. I am new to Hibernate. So i hav a problem. I am creating a jsp web page for managing family information. And in that page I had to save information about the head of family & other family members. And the information about other members is entered by the textboxes generated at run time (by javascript). I am using ...

52. Hibernate used behind EJB 2.1 session beans    forum.hibernate.org

Hi Behind EJB2.1 stateless sessionbeans we are using Hibernate to access a database. The problem with this is that because the Hibernate session is closed when the EJB-call ends we do not use lazy-loading. This results in poor performance. Does anyone have a good solution to using Hibernate behind EJBs this way? I am wondering about how you did retrieve/searches and ...

53. Skip the field in the bean from mapping to database    forum.hibernate.org

I am new hibernate user. I am trying to skip one of the field in the bean, from mapping to databse. But it throws error , how to do it. Is this possible to to something like this. private String notes; private Long authorId; private String authorName; // Want to skip this field from mapping to database, private List objects; Caused ...

54. Mapping through Non-Bean methods    forum.hibernate.org

Hi, I am working on a project using hibernate 3.2.0 . I have to use a previously built class(non-bean), that i can't change, that i have to map. This class has a public constructor (no setter methods) and a method named stringValue (no getter methods). Now, I need to map this to a particular column(varchar) in the database. I am using ...

55. Mapping through Non-Bean methods    forum.hibernate.org

Hi, I am working on a project using hibernate 3.2.0 . I have to use a previously built class(non-bean), that i can't change, that i have to map. This class has a public constructor (no setter methods) and a method named stringValue (no getter methods). Now, I need to map this to a particular column(varchar) in the database. I am using ...

56. Error creating bean with name 'sessionFactory'    forum.hibernate.org

Beginner Joined: Mon Jan 07, 2008 4:13 am Posts: 22 Hi, i have big problem with Hibernate 3.2.5.ga, Hibernate Annotations 3.3.0.GA and Spring 2.5, tomcat 6.0.14, acegi 1.0.6 (and ehcache 1.3.0) in applicationContext-resources.xml : Code:

57. more than one OneToOne in a bean class gives problem    forum.hibernate.org

This is my bean class structure Code: @Entity @Table(name="TBL_PRODUCTS") public class TblProducts implements Serializable { @Id @Column(name="PRODUCT_ID") private BigDecimal productId; @Column(name="PRODUCT_NAME") private String productName; @JoinColumn(name="BRAND_NAME") private String brandname; ...

58. Why not use Hibernate beans as DTO in layered architecture    forum.hibernate.org

public class OrmObject1 implements ORMObj1Intf { public Set getOrmObject2s() { ... } public void setOrmObject2s(Set) { } public int getId() { ...

59. bean    forum.hibernate.org

I am new to hibernate.i am using struts1.3.5 with hibernate 3.0 for web project. pl advice 1) struts tag library is sufficient ? or JSTL is required. 2) struts lay out is sufficient ? 3) where i will get the hibernate api to download? 4) how to handle both struts bean and hibernate java bean? 5) recommend a good book for ...

60. Ignore property in a bean    forum.hibernate.org

public class ValueObject implements Serializable { protected boolean selected; public boolean isSelected() { return selected; } public void setSelected(boolean selected) { this.selected = selected; } }

61. EJB3 entity beans to Hibernate    forum.hibernate.org

62. How to store the result in non managed bean (non entity)    forum.hibernate.org

Hello all. Could you help me with subject. I have many stored procedures in Oracle. Now I use SQL Query and manual extract the resultSet to custom bean. I would like to use hbm mapping file as used for entity. but want to extract in custom non managed bean. for example:

63. table is not mapped [ from Bean]    forum.hibernate.org

hai i have this things in my webapp 1) index.html 3) Action Class 4) DAO in index.html i have one submit button if i click on that button the submit action will execute the DAO code which is has hibernate coding to retrive the list from the database table Usersys and my code is as follows index.html ===================================================================================

64. Using Entity Beans inside external called classes    forum.hibernate.org

Hibernate version: 3.2 Application server: jboss 4.2.2 hi everyone my webapp loads external "plugin" classes using a xml conf file. Everything worked fine while the "plugin" classes and the rest of the webapp where on the same ear file, but i need to split them up, so i moved the plugins in a different jar i placed inside the lib directory. ...

65. createNativeQuery and map result to simple bean    forum.hibernate.org

Hi .. Using OpenJPA I have code running that implement a FastLaneReader pattern using createNativeQuery and a simple databean to be used in the UI layer. The case could be : I need to query a customer table in a separate schema (not managed by my application) and just display a list for selection. I am unable to make this work ...

66. BeanCreationException: Error creating bean with name...    forum.hibernate.org

Newbie Joined: Wed Mar 11, 2009 8:31 am Posts: 5 Hello, all! problem: +-------------------------------------------------------------------------------------------------------------+ %tomcat_home%\logs\localhost.log: +-------------------------------------------------------------------------------------------------------------+ ... SEVERE: StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/hello.htm' defined in ServletContext resource [/WEB-INF/springapp-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.InvalidPropertyException: Invalid property 'factoryManager' of bean class [springapp.web.FactoryController]: No property 'factoryManager' found at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480) ... +-------------------------------------------------------------------------------------------------------------+ %tomcat_home%\logs\stdout.log: +-------------------------------------------------------------------------------------------------------------+ ... 16:28:12,750 DEBUG DefaultListableBeanFactory:213 - ...

68. Unable to reference JPA entity beans in a different package    forum.hibernate.org

I am getting this error, while trying to deploy beans annotated using JPA. Beans from the second package or referencing beans from the first package and it fails with the following error. What should I do in order to resolve this class loader issue? org.hibernate.AnnotationException: @OneToOne or @ManyToOne on com.two.domain.Idea.user references an unknown entity: com.one.domain.User: @OneToOne or @ManyToOne on com.two.domain.Idea.user references ...