title: how to create SQL View in Geoserver with command line
body: <p>The following is the code I use, which does not work</p>
  
  <pre><code>curl -v -u admin:geoserver -XPUT -H 'Content-type: text/xml' -d
  '&lt;featureType&gt;
  &lt;name&gt;h12v10_locations_20ztesting&lt;/name&gt;
  &lt;nativeName&gt;h12v10_locations_20ztesting&lt;/nativeName&gt;
  &lt;srs&gt;EPSG:4326&lt;/srs&gt;
  &lt;metadata&gt;&lt;entry&gt;
  &lt;virtualTable&gt;&lt;name&gt;h12v10_locations_20ztesting&lt;/name&gt;
  &lt;sql&gt;select gid, poly_label, data_score, data_time, year, the_geom
  from h12v10_locations_2002
  order by gid asc&lt;/sql&gt;
  &lt;keyColumn&gt;feature_id&lt;/keyColumn&gt;
  &lt;geometry&gt;&lt;name&gt;the_geom&lt;/name&gt;&lt;type&gt;POINT&lt;/type&gt;&lt;srid&gt;4326&lt;/srid&gt;&lt;/geometry&gt;
  &lt;/virtualTable&gt;&lt;/entry&gt;&lt;/metadata&gt;&lt;/featureType&gt;'
  http://localhost:8080/geoserver/rest/layers/cite:h12v10_locations_20ztesting.xml
  </code></pre>
  
  <p>I want to use sql view than creating layer is that when I update data is PostGIS, the order of data entries retrieved by client will change. For example, when I update id=1, the first entries retrieved will become id=2 from id=1</p>