Announcement Announcement Module
Collapse
No announcement yet.
Data Validation against Hibernate schema files Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Data Validation against Hibernate schema files

    Below you will see code from The Hibernate site to obtain what I am trying to do -- Yet we are using Spring to interact with Hibernate...
    How do I do this from within Spring ?

    Code:
    Configuration cfg = blabla.getHibConfiguration();
    PersistentClass persistentClass = cfg.getClassMapping(clazz);
    Property property = persistentClass.getProperty(propertyName);
    
    Iterator it = property.getColumnIterator();
    if (it.hasNext()) {
        Column c = (Column) it.next();
        return c.getLength();
    }

  • #2
    Code:
      ...
      LocalSessionFactoryBean lsfb = (LocalSessionFactoryBean) ctx.getBean("&SessionFactory");
      Configuration cfg = lsfb.getConfiguration();
      ...

    Comment

    Working...
    X