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????