我想在运行时获取休眠中表列的长度。
我从stackoverflow获得了一些代码,但对获取PersistentClass
对象有疑问
来自堆栈溢出的代码:
Property property = (Property) persistentClass.getProperty(propertyName);
Column col = (Column)property.getColumnIterator().next();
int length = col.getLength();
System.out.print("\t");
System.out.print(persister.getPropertyColumnNames(propertyName)[0]);
System.out.print("\t Column length :::");
System.out.print(length);