-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate console perpspective and configuration
PostPosted: Fri Apr 22, 2005 9:53 am 
Newbie

Joined: Thu Apr 14, 2005 8:21 am
Posts: 5
Hi all!!! I have installed eclipse3.1m6 and jbossIDE and hibernate-tools3alpha1 to use with hibernate3.0. I have some troubles when i'm trying to to create the session factory. Thats the story:
this is part of my 2 mappings between table and class:
Code:
...
        <property name="c_sort2" column="C_SORT2" type="java.lang.String"  not-null="true" />

...

as you can see column in table is named with "_" as word separator. now I'm trying to made such class members in hibernate:
Code:
...
   public void setC_Sort2(String cSort2) {
      // TODO Auto-generated method stub
      super.setC_Sort2(cSort2);
   }
...

but as I've been said earlier i have an exception like this:
Code:
org.hibernate.PropertyNotFoundException: Could not find a getter for c_sort2 in class ru.zenith.dealer.service.hibernate.Operatio
   at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:207)
   at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:201)
   at org.hibernate.mapping.Property.getGetter(Property.java:161)
   at org.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:371)
   at org.hibernate.persister.BasicEntityPersister.<init>(BasicEntityPersister.java:352)
   at org.hibernate.persister.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:95)
   at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:44)
   at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:196)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1031)
   at org.hibernate.console.ConsoleConfiguration$1.execute(ConsoleConfiguration.java:221)
   at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:76)
   at org.hibernate.console.ConsoleConfiguration.initSessionFactory(ConsoleConfiguration.java:219)
   at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:51)
   at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:47)
   at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:167)
   at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
   at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
   at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842)
   at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2894)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2527)
   at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1570)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1534)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:306)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
   at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
   at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:228)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:156)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.eclipse.core.launcher.Main.invokeFramework(Main.java:315)
   at org.eclipse.core.launcher.Main.basicRun(Main.java:268)
   at org.eclipse.core.launcher.Main.run(Main.java:942)
   at org.eclipse.core.launcher.Main.main(Main.java:926)


I overcome this problem only when rename class field to "csort" and the getter/setter of this field to getCsort\setCsort. What rules are for getters and setters if class field have "_" in it's name????


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 22, 2005 10:46 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
from c_sort2 hibernate will look for c_sort2 or C_sort2 - not C_Sort2.
Use c_Sort2 as the property name instead

-max

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.