mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
No effective change - code format and tidy up
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
package com.avaje.ebeaninternal.api;
|
||||
|
||||
import com.avaje.ebean.ExpressionFactory;
|
||||
import com.avaje.ebeaninternal.server.expression.FilterExprPath;
|
||||
|
||||
public interface SpiExpressionFactory extends ExpressionFactory {
|
||||
|
||||
/**
|
||||
* Create another expression factory with a given sub path.
|
||||
*/
|
||||
public ExpressionFactory createExpressionFactory();//FilterExprPath prefix);
|
||||
|
||||
/**
|
||||
* Create another expression factory with a given sub path.
|
||||
*/
|
||||
public ExpressionFactory createExpressionFactory();
|
||||
|
||||
}
|
||||
|
||||
+7
-11
@@ -1,19 +1,15 @@
|
||||
package com.avaje.ebeaninternal.server.deploy;
|
||||
|
||||
import com.avaje.ebeaninternal.server.deploy.meta.DeployBeanPropertySimpleCollection;
|
||||
import com.avaje.ebeaninternal.server.type.ScalarType;
|
||||
|
||||
public class BeanPropertySimpleCollection<T> extends BeanPropertyAssocMany<T> {
|
||||
|
||||
private final ScalarType<T> collectionScalarType;
|
||||
|
||||
public BeanPropertySimpleCollection(BeanDescriptorMap owner, BeanDescriptor<?> descriptor, DeployBeanPropertySimpleCollection<T> deploy) {
|
||||
super(owner, descriptor, deploy);
|
||||
this.collectionScalarType = deploy.getCollectionScalarType();
|
||||
}
|
||||
public BeanPropertySimpleCollection(BeanDescriptorMap owner, BeanDescriptor<?> descriptor, DeployBeanPropertySimpleCollection<T> deploy) {
|
||||
super(owner, descriptor, deploy);
|
||||
}
|
||||
|
||||
public void initialise() {
|
||||
super.initialise();
|
||||
}
|
||||
|
||||
public void initialise() {
|
||||
super.initialise();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,18 +13,17 @@ import com.avaje.ebeaninternal.server.deploy.DbSqlContext;
|
||||
import com.avaje.ebeaninternal.server.deploy.IntersectionRow;
|
||||
import com.avaje.ebeaninternal.server.persist.dml.GenerateDmlRequest;
|
||||
import com.avaje.ebeaninternal.server.persist.dmlbind.BindableRequest;
|
||||
import com.avaje.ebeaninternal.util.ValueUtil;
|
||||
|
||||
/**
|
||||
* Imported Embedded id.
|
||||
*/
|
||||
public class ImportedIdEmbedded implements ImportedId {
|
||||
|
||||
final BeanPropertyAssoc<?> owner;
|
||||
private final BeanPropertyAssoc<?> owner;
|
||||
|
||||
final BeanPropertyAssocOne<?> foreignAssocOne;
|
||||
private final BeanPropertyAssocOne<?> foreignAssocOne;
|
||||
|
||||
final ImportedIdSimple[] imported;
|
||||
private final ImportedIdSimple[] imported;
|
||||
|
||||
public ImportedIdEmbedded(BeanPropertyAssoc<?> owner, BeanPropertyAssocOne<?> foreignAssocOne, ImportedIdSimple[] imported) {
|
||||
this.owner = owner;
|
||||
|
||||
+18
-30
@@ -2,40 +2,28 @@ package com.avaje.ebeaninternal.server.deploy.meta;
|
||||
|
||||
import com.avaje.ebean.bean.BeanCollection.ModifyListenMode;
|
||||
import com.avaje.ebeaninternal.server.deploy.ManyType;
|
||||
import com.avaje.ebeaninternal.server.type.ScalarType;
|
||||
|
||||
public class DeployBeanPropertySimpleCollection<T> extends DeployBeanPropertyAssocMany<T> {
|
||||
|
||||
private final ScalarType<T> collectionScalarType;
|
||||
|
||||
public DeployBeanPropertySimpleCollection(DeployBeanDescriptor<?> desc, Class<T> targetType, ScalarType<T> scalarType, ManyType manyType) {
|
||||
super(desc, targetType, manyType);
|
||||
this.collectionScalarType = scalarType;
|
||||
this.modifyListenMode = ModifyListenMode.ALL;
|
||||
}
|
||||
public DeployBeanPropertySimpleCollection(DeployBeanDescriptor<?> desc, Class<T> targetType, ManyType manyType) {
|
||||
super(desc, targetType, manyType);
|
||||
this.modifyListenMode = ModifyListenMode.ALL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the scalarType of the collection elements.
|
||||
*/
|
||||
public ScalarType<T> getCollectionScalarType() {
|
||||
return collectionScalarType;
|
||||
}
|
||||
/**
|
||||
* Returns false as never a ManyToMany.
|
||||
*/
|
||||
@Override
|
||||
public boolean isManyToMany() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns false as never a ManyToMany.
|
||||
*/
|
||||
@Override
|
||||
public boolean isManyToMany() {
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Returns true as always Unidirectional.
|
||||
*/
|
||||
@Override
|
||||
public boolean isUnidirectional() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true as always Unidirectional.
|
||||
*/
|
||||
@Override
|
||||
public boolean isUnidirectional() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -9,34 +9,33 @@ import com.avaje.ebeaninternal.server.deploy.DRawSqlMeta;
|
||||
*/
|
||||
public class AnnotationSql extends AnnotationParser {
|
||||
|
||||
public AnnotationSql(DeployBeanInfo<?> info) {
|
||||
super(info);
|
||||
}
|
||||
public AnnotationSql(DeployBeanInfo<?> info) {
|
||||
super(info);
|
||||
}
|
||||
|
||||
public void parse() {
|
||||
Class<?> cls = descriptor.getBeanType();
|
||||
Sql sql = cls.getAnnotation(Sql.class);
|
||||
if (sql != null){
|
||||
setSql(sql);
|
||||
}
|
||||
|
||||
|
||||
SqlSelect sqlSelect = cls.getAnnotation(SqlSelect.class);
|
||||
if (sqlSelect != null){
|
||||
setSqlSelect(sqlSelect);
|
||||
}
|
||||
}
|
||||
|
||||
private void setSql(Sql sql) {
|
||||
SqlSelect[] select = sql.select();
|
||||
for (int i = 0; i < select.length; i++) {
|
||||
setSqlSelect(select[i]);
|
||||
}
|
||||
}
|
||||
public void parse() {
|
||||
Class<?> cls = descriptor.getBeanType();
|
||||
Sql sql = cls.getAnnotation(Sql.class);
|
||||
if (sql != null) {
|
||||
setSql(sql);
|
||||
}
|
||||
|
||||
private void setSqlSelect(SqlSelect sqlSelect) {
|
||||
SqlSelect sqlSelect = cls.getAnnotation(SqlSelect.class);
|
||||
if (sqlSelect != null) {
|
||||
setSqlSelect(sqlSelect);
|
||||
}
|
||||
}
|
||||
|
||||
DRawSqlMeta rawSqlMeta = new DRawSqlMeta(sqlSelect);
|
||||
descriptor.add(rawSqlMeta);
|
||||
}
|
||||
private void setSql(Sql sql) {
|
||||
SqlSelect[] select = sql.select();
|
||||
for (int i = 0; i < select.length; i++) {
|
||||
setSqlSelect(select[i]);
|
||||
}
|
||||
}
|
||||
|
||||
private void setSqlSelect(SqlSelect sqlSelect) {
|
||||
|
||||
DRawSqlMeta rawSqlMeta = new DRawSqlMeta(sqlSelect);
|
||||
descriptor.add(rawSqlMeta);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -264,7 +264,7 @@ public class DeployCreateProperties {
|
||||
try {
|
||||
ScalarType<?> scalarType = typeManager.getScalarType(targetType);
|
||||
if (scalarType != null) {
|
||||
return new DeployBeanPropertySimpleCollection(desc, targetType, scalarType, manyType);
|
||||
return new DeployBeanPropertySimpleCollection(desc, targetType, manyType);
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
logger.debug("expected non-scalar type" + e.getMessage());
|
||||
|
||||
Reference in New Issue
Block a user