Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use Nhibernate Validator + NHib component + ddl
    primarykey
    data
    text
    <p>I just configured my NHibValidator. My NHibernate creates the DB schema. When I set MaxLenght="20" to some property of a class then in the database the length appears in the database column. I am doing this in the NHibValidator xml file. But the problem is that I have components and cannot figure out how to achieve this behaviour. The component is configured correctly in the Customer.hbm.xml file.</p> <p>EDIT: Well, I found that Hibernate Validator users had the same problem two years ago. <a href="http://opensource.atlassian.com/projects/hibernate/browse/HV-25" rel="nofollow noreferrer">http://opensource.atlassian.com/projects/hibernate/browse/HV-25</a> Is this an issue for NHibernate Validator or it is fixed. If it is working tell me how please. </p> <pre><code>----------------------------------------------------- public class Customer { public virtual string Name{get;set;} public virtual Contact Contacts{ get; } } ----------------------------------------------------- public class Contact { public virtual string Address{get;set;} } ----------------------------------------------------- &lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;nhv-mapping xmlns="urn:nhibernate-validator-1.0" namespace="MyNamespace" assembly="MyAssembly"&gt; &lt;class name="Customer"&gt; &lt;property name="Name"&gt; &lt;length max="20"/&gt; &lt;/property&gt; &lt;property name="Contacts"&gt; &lt;notNull/&gt; &lt;valid/&gt; &lt;/property&gt; &lt;/class&gt; &lt;/nhv-mapping&gt; ----------------------------------------------------- &lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;nhv-mapping xmlns="urn:nhibernate-validator-1.0" namespace="MyNamespace" assembly="MyAssembly"&gt; &lt;class name="Contact"&gt; &lt;property name="Address"&gt; &lt;length max="50"/&gt; &lt;valid/&gt; &lt;/property&gt; &lt;/class&gt; &lt;/nhv-mapping&gt; ----------------------------------------------------- </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload