Drools bytecode generates these beans without generating java source code (if you are using the declare, not the data modeller). Having said that, it is very simple:
declare Here
location: String @key
end
Generates a java class roughly equivalent to:
public class Here implements Serializable {
private String location;
public Here() {}
public Here( String location ) {
this.location = location;
}
public String getLocation() { return location; }
public void setLocation(String location) { this.location = location; }
// generates a toString()
// generates a hashCode()/equals() method that use the location's hashcode()/equals()
}
I did this from memory, but it is pretty much all it does. Nothing complex there, just a javabean really.
The difference to not using @key is that the hashCode()/equals() methods would not take "location" in consideration, and in this case, since there are no other attributes, would then rely on system identity.
Edson