/*
 * Copyright 1999-2010 Luca Garulli (l.garulli--at--orientechnologies.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.orientechnologies.orient.core.record;

import java.util.Set;

import com.orientechnologies.orient.core.db.record.ODatabaseRecord;
import com.orientechnologies.orient.core.exception.OValidationException;
import com.orientechnologies.orient.core.metadata.schema.OClass;

/**
 * Generic record representation with a schema definition. The object can be reused across call to the database.
 */
public interface ORecordSchemaAware<T> extends ORecordInternal<T> {

  public <RET> RET field(String iPropertyName);

  public ORecordSchemaAware<T> field(String iPropertyName, Object iValue);

  public Object removeField(String iPropertyName);

  public Set<String> fieldNames();

  public Object[] fieldValues();

  public int size();

  public String getClassName();

  public void setClassName(String iClassName);

  public void setClassNameIfExists(String iClassName);

  public OClass getSchemaClass();

  public void validate() throws OValidationException;

  public ORecordSchemaAware<T> fill(ODatabaseRecord iDatabase, int iClassId, int iClusterId, long iPosition, int iVersion);
}

@@ -934,16 +934,81 @@
 OClass;%0D
+%0Aimport com.orientechnologies.orient.core.metadata.schema.OType;%0D
 %0A%0D%0A/**%0D%0A
@@ -1193,26 +1193,25 @@
 nal%3CT%3E %7B%0D%0A%0D%0A
-  
+%09
 public %3CRET%3E
@@ -1239,34 +1239,33 @@
 opertyName);%0D%0A%0D%0A
-  
+%09
 public ORecordSc
@@ -1320,26 +1320,88 @@
 iValue);%0D%0A%0D%0A
-  
+%09public %3CRET%3E RET field(String iPropertyName, OType iType);%0D%0A%0D%0A%09
 public Objec
@@ -1436,26 +1436,25 @@
 tyName);%0D%0A%0D%0A
-  
+%09
 public Set%3CS
@@ -1473,26 +1473,25 @@
 Names();%0D%0A%0D%0A
-  
+%09
 public Objec
@@ -1508,26 +1508,25 @@
 alues();%0D%0A%0D%0A
-  
+%09
 public int s
@@ -1531,26 +1531,25 @@
  size();%0D%0A%0D%0A
-  
+%09
 public Strin
@@ -1565,26 +1565,25 @@
 sName();%0D%0A%0D%0A
-  
+%09
 public void 
@@ -1614,26 +1614,25 @@
 ssName);%0D%0A%0D%0A
-  
+%09
 public void 
@@ -1671,26 +1671,25 @@
 ssName);%0D%0A%0D%0A
-  
+%09
 public OClas
@@ -1707,26 +1707,25 @@
 Class();%0D%0A%0D%0A
-  
+%09
 public void 
@@ -1767,18 +1767,17 @@
 ion;%0D%0A%0D%0A
-  
+%09
 public O

Patch by Luca Molino on a bug in indexing LINK properties