Suppose the table have two fields:
url(varchar), type(smallint).
When the content of url is type of page,the type should be 1,then it should be 0.
That’s to say,
when url like that :
/xxx.html
/xx/xx.action
/xxx.jsp
/xxx.htm
.....
The type should be 1.
When the url like this:
/xx.js
/xx.css
/xx.ico
/xx.jpg
/xx.png
....
type should be 0. It means that this url is not a web page.
And I am using hibernate,I wonder how to mapping this association in the mapping.xml?
Hibernate won’t do that for you. This is business logic and should be coded in a service class, or in the entity itself :