How Ebean check if a model has been enhanced or not?
I defined a base Model which doesn't has fields, and enhance it by Ebean's eclipse plugin. Then I use a java decompiler to decompile it, found ebean has add some fields and methods to it:

	private static String _EBEAN_MARKER = "play.modules.ebean.Model";

	protected EntityBeanIntercept _ebean_intercept = new EntityBeanIntercept(this);

	protected transient Object _ebean_identity;

	public String _ebean_getMarker() {
		return _EBEAN_MARKER;
	}

	public EntityBeanIntercept _ebean_getIntercept() {
		return this._ebean_intercept;
	}

	public EntityBeanIntercept _ebean_intercept() {
		if (this._ebean_intercept == null)
			this._ebean_intercept = new EntityBeanIntercept(this);
		return this._ebean_intercept;
	}

	public void addPropertyChangeListener(PropertyChangeListener listener) {
		this._ebean_intercept.addPropertyChangeListener(listener);
	}

	public void addPropertyChangeListener(String name, PropertyChangeListener listener) {
		this._ebean_intercept.addPropertyChangeListener(name, listener);
	}

	public void removePropertyChangeListener(PropertyChangeListener listener) {
		this._ebean_intercept.removePropertyChangeListener(listener);
	}

	public void removePropertyChangeListener(String name, PropertyChangeListener listener) {
		this._ebean_intercept.removePropertyChangeListener(name, listener);
	}

	public void _ebean_setEmbeddedLoaded() {}

	public boolean _ebean_isEmbeddedNewOrDirty() {
		return false;
	}

	public Object _ebean_newInstance() {
		return new Model();
	}

Then I copied these code to the original Model class, disabled the Ebean's enhancer, compile it by eclipse.

I thought it should have the same effect as enhancing by Ebean. 

Then I packaged it as a jar, put it in my project, defined a model class `Article` to extend it. 

But there is an error:

    An unexpected error occured caused by exception PersistenceException:
    java.lang.IllegalStateException: Class [class test.Model] is not enhanced 
      and [class models.Article] is - (you can not mix!!)

It seems Ebean not treat my new `Model` class as enhanced. I wonder how Ebean check if a class has been enhanced by it or not?


How Ebean check if a model has been enhanced or not?
===

I defined a base Model which doesn't has fields, and enhance it by Ebean's eclipse plugin. Then I use a java decompiler to decompile it, found ebean has add some fields and methods to it:

	private static String _EBEAN_MARKER = "play.modules.ebean.Model";

	protected EntityBeanIntercept _ebean_intercept = new EntityBeanIntercept(this);

	protected transient Object _ebean_identity;

	public String _ebean_getMarker() {
		return _EBEAN_MARKER;
	}

	public EntityBeanIntercept _ebean_getIntercept() {
		return this._ebean_intercept;
	}

	public EntityBeanIntercept _ebean_intercept() {
		if (this._ebean_intercept == null)
			this._ebean_intercept = new EntityBeanIntercept(this);
		return this._ebean_intercept;
	}

	public void addPropertyChangeListener(PropertyChangeListener listener) {
		this._ebean_intercept.addPropertyChangeListener(listener);
	}

	public void addPropertyChangeListener(String name, PropertyChangeListener listener) {
		this._ebean_intercept.addPropertyChangeListener(name, listener);
	}

	public void removePropertyChangeListener(PropertyChangeListener listener) {
		this._ebean_intercept.removePropertyChangeListener(listener);
	}

	public void removePropertyChangeListener(String name, PropertyChangeListener listener) {
		this._ebean_intercept.removePropertyChangeListener(name, listener);
	}

	public void _ebean_setEmbeddedLoaded() {}

	public boolean _ebean_isEmbeddedNewOrDirty() {
		return false;
	}

	public Object _ebean_newInstance() {
		return new Model();
	}

Then I copied these code to the original Model class, disabled the Ebean's enhancer, compile it by eclipse.

I thought it should have the same effect as enhancing by Ebean. 

Then I packaged it as a jar, put it in my project, defined a model class `Article` to extend it. 

But there is an error:

    An unexpected error occured caused by exception PersistenceException:
    java.lang.IllegalStateException: Class [class test.Model] is not enhanced 
      and [class models.Article] is - (you can not mix!!)

It seems Ebean not treat my new `Model` class as enhanced. I wonder how Ebean check if a class has been enhanced by it or not?

