Orm code sample

hy
please how can i configure orm code sample for visual studio .net
because i have probleme when i try to execute the project
when i may put hibernate.cfg.xml file

thanks for your help.

Hi bentata,

The following page can help you understand how to work with .NET ORM:
http://resource.visual-paradigm.com/orm.html#net_orm

Please feel free to let me know if there are any questions.

Best Regards,
Jick

thanks jick

i will lean it and answer you
thanks

You are welcome! :smiley:

i have

*** at NHibernate.Property.BasicPropertyAccessor.GetSetter(Type type, String propertyName)
at NHibernate.Persister.AbstractEntityPersister…ctor(PersistentClass model, ISessionFactoryImplementor factory
)
at NHibernate.Persister.EntityPersister…ctor(PersistentClass model, ISessionFactoryImplementor factory)
at NHibernate.Persister.PersisterFactory.CreateClassPersister(PersistentClass model, ISessionFactoryImplementor
factory)
at NHibernate.Impl.SessionFactoryImpl…ctor(Configuration cfg, Settings settings)
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at Orm.Util.ORMSessionFactory…ctor(Configuration cfg)
at Orm.Util.ThreadBaseSessionController…ctor(Configuration cfg)
PersistentException
at Orm.Util.ThreadBaseSessionController…ctor(Configuration cfg)
at Orm.PersistentManager…ctor(DotNetConnectionSetting connectionSetting, SessionType sessionType)
at DAL.produits.ConsoleApplication2PersistentManager…ctor() in E:\Documents and Settings\Omar1\Mes documents\V
isual Studio 2005\Projects\ConsoleApplication2\ConsoleApplication2\DAL\produits\ConsoleApplication2PersistentManag
er.cs:line 29
at DAL.produits.ConsoleApplication2PersistentManager.Instance() in E:\Documents and Settings\Omar1\Mes document
s\Visual Studio 2005\Projects\ConsoleApplication2\ConsoleApplication2\DAL\produits\ConsoleApplication2PersistentMa
nager.cs:line 39
at DAL.produits.Article.Save() in E:\Documents and Settings\Omar1\Mes documents\Visual Studio 2005\Projects\Con
soleApplication2\ConsoleApplication2\DAL\produits\Article.cs:line 30

Dear bentata,

Could you send me any sample project and code so that I can repeat the problem you have? Thank you.

Best Regards,
Jick

[quote=Jick]Hi bentata,

The following page can help you understand how to work with .NET ORM:
http://resource.visual-paradigm.com/orm.html#net_orm

Please feel free to let me know if there are any questions.

Best Regards,
Jick[/quote]

hey i got 2 question if you keep on putting on the cheat instant titan can
u get 5 of them and how does this work

Hi justin,

Sorry but I do not understand what you are asking. Could you clarify a little bit?

Best regards,
Jick

I am having a spot of bother with the sample code to create database schemas.

package ormsamples;

import org.orm.*;
public class CreateBobDatabaseSchema {
public static void main(String[] args) {
try {
ORMDatabaseInitiator.createSchema(com.sb.first.BobPersistentManager.instance());
com.sb.first.BobPersistentManager.instance().disposePersistentManager();
}
catch (Exception e) {
e.printStackTrace();
}
}
}

Errors with :

Exception in thread “main” java.lang.NoSuchMethodError: org.hibernate.dialect.Dialect.supportConstraintName()Z
at org.orm.ertodb.TableDDLGenerator.generateCreateDDL(TableDDLGenerator.java:188)
at org.orm.ertodb.DDLGenerator.createSchema(DDLGenerator.java:143)
at org.orm.ORMDatabaseInitiator.createSchema(ORMDatabaseInitiator.java:32)
at ormsamples.CreateBobDatabaseSchema.main(CreateBobDatabaseSchema.java:11)

Hi MisfitEq,

Thanks for your post. Could you please attach the complete sample code for investigation? Thanks in advance!

Best regards,
Lilian Wong

Just ran into this as well as the solution; the problem is not in the ORM code or anything like that but rather in Hibernate itself.

It’s some kind of class loading problem and I ran into this such that the application would work in the development environment but crash with this error during runtime.

Turns out that at runtime my application loader had a slightly different classpath (same libs but in different order) and somehow this screwed up the Hibernate classloader.

Similar issues are referenced throughout the web.

I fixed my issue by messing with my class path until it worked (reproduced the same one that worked in my development).

UPDATE: If orm.jar ends up in the classpath before hibernate3.jar then it should work.