mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-12 22:41:35 +00:00
#2359 - Rename plugin api methods with deprecation - Property
This commit is contained in:
1 parent
bc02eeac57
commit
632f04c76b
66 files changed
+265
-193
No files matched your search
@@ -52,7 +52,7 @@ public final class ManyWhereJoins implements Serializable {
|
||||
String join = elProp.getElPrefix();
|
||||
BeanProperty p = elProp.getBeanProperty();
|
||||
if (p instanceof BeanPropertyAssocMany<?>) {
|
||||
join = addManyToJoin(join, p.getName());
|
||||
join = addManyToJoin(join, p.name());
|
||||
}
|
||||
if (join != null) {
|
||||
addJoin(join);
|
||||
|
||||
+4
-4
@@ -19,7 +19,7 @@ public final class CachedBeanDataFromBean {
|
||||
if (idProperty != null) {
|
||||
int propertyIndex = idProperty.getPropertyIndex();
|
||||
if (ebi.isLoadedProperty(propertyIndex)) {
|
||||
data.put(idProperty.getName(), idProperty.getCacheDataValue(bean));
|
||||
data.put(idProperty.name(), idProperty.getCacheDataValue(bean));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,15 +27,15 @@ public final class CachedBeanDataFromBean {
|
||||
final boolean dirty = ebi.isDirty();
|
||||
for (BeanProperty prop : desc.propertiesNonMany()) {
|
||||
if (dirty && ebi.isDirtyProperty(prop.getPropertyIndex())) {
|
||||
data.put(prop.getName(), prop.getCacheDataValueOrig(ebi));
|
||||
data.put(prop.name(), prop.getCacheDataValueOrig(ebi));
|
||||
} else if (ebi.isLoadedProperty(prop.getPropertyIndex())) {
|
||||
data.put(prop.getName(), prop.getCacheDataValue(bean));
|
||||
data.put(prop.name(), prop.getCacheDataValue(bean));
|
||||
}
|
||||
}
|
||||
|
||||
for (BeanPropertyAssocMany<?> prop : desc.propertiesMany()) {
|
||||
if (prop.isElementCollection()) {
|
||||
data.put(prop.getName(), prop.getCacheDataValue(bean));
|
||||
data.put(prop.name(), prop.getCacheDataValue(bean));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -36,9 +36,9 @@ public final class CachedBeanDataToBean {
|
||||
}
|
||||
|
||||
private static void loadProperty(EntityBean bean, CachedBeanData cacheBeanData, EntityBeanIntercept ebi, BeanProperty prop, PersistenceContext context) {
|
||||
if (cacheBeanData.isLoaded(prop.getName())) {
|
||||
if (cacheBeanData.isLoaded(prop.name())) {
|
||||
if (!ebi.isLoadedProperty(prop.getPropertyIndex())) {
|
||||
Object value = cacheBeanData.getData(prop.getName());
|
||||
Object value = cacheBeanData.getData(prop.name());
|
||||
prop.setCacheDataValue(bean, value, context);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,18 +93,18 @@ final class DefaultBeanLoader {
|
||||
|
||||
query.select(parentDesc.getIdBinder().getIdProperty());
|
||||
if (onlyIds) {
|
||||
query.fetch(many.getName(), many.getTargetIdProperty());
|
||||
query.fetch(many.name(), many.getTargetIdProperty());
|
||||
} else {
|
||||
query.fetch(many.getName());
|
||||
query.fetch(many.name());
|
||||
}
|
||||
if (filterMany != null) {
|
||||
query.setFilterMany(many.getName(), filterMany);
|
||||
query.setFilterMany(many.name(), filterMany);
|
||||
}
|
||||
|
||||
query.where().idEq(parentId);
|
||||
query.setBeanCacheMode(CacheMode.OFF);
|
||||
query.setMode(Mode.LAZYLOAD_MANY);
|
||||
query.setLazyLoadManyPath(many.getName());
|
||||
query.setLazyLoadManyPath(many.name());
|
||||
query.setPersistenceContext(pc);
|
||||
if (ebi.isReadOnly()) {
|
||||
query.setReadOnly(true);
|
||||
|
||||
@@ -713,7 +713,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
}
|
||||
// we actually need to do a query because we don't know the type without the discriminator
|
||||
// value, just select the id property and discriminator column (auto added)
|
||||
return find(type).select(idProp.getName()).setId(id).findOne();
|
||||
return find(type).select(idProp.name()).setId(id).findOne();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2284,7 +2284,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
if (idProperty == null) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
Object id = idProperty.getVal(entityBean);
|
||||
Object id = idProperty.value(entityBean);
|
||||
if (entityBean._ebean_getIntercept().isNew() && id != null) {
|
||||
// Primary Key is changeable only on new models - so skip check if we are not new
|
||||
Query<?> query = new DefaultOrmQuery<>(beanDesc, this, expressionFactory);
|
||||
@@ -2311,14 +2311,14 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
ExpressionList<?> exprList = query.where();
|
||||
if (!entityBean._ebean_getIntercept().isNew()) {
|
||||
// if model is not new, exclude ourself.
|
||||
exprList.ne(idProperty.getName(), idProperty.getVal(entityBean));
|
||||
exprList.ne(idProperty.name(), idProperty.value(entityBean));
|
||||
}
|
||||
for (Property prop : props) {
|
||||
Object value = prop.getVal(entityBean);
|
||||
Object value = prop.value(entityBean);
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
exprList.eq(prop.getName(), value);
|
||||
exprList.eq(prop.name(), value);
|
||||
}
|
||||
if (findCount(query, transaction) > 0) {
|
||||
Set<Property> ret = new LinkedHashSet<>();
|
||||
|
||||
@@ -470,7 +470,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
|
||||
if (mapKey == null) {
|
||||
BeanProperty idProp = beanDescriptor.idProperty();
|
||||
if (idProp != null) {
|
||||
query.setMapKey(idProp.getName());
|
||||
query.setMapKey(idProp.name());
|
||||
} else {
|
||||
throw new PersistenceException("No mapKey specified for query");
|
||||
}
|
||||
|
||||
@@ -1341,7 +1341,7 @@ public final class PersistRequestBean<T> extends PersistRequest implements BeanP
|
||||
BeanProperty property = beanDescriptor.propertyByIndex(i);
|
||||
if (property.isCacheDataInclude()) {
|
||||
Object val = property.getCacheDataValue(bean);
|
||||
changes.put(property.getName(), val);
|
||||
changes.put(property.name(), val);
|
||||
if (property.isNaturalKey()) {
|
||||
updateNaturalKey = true;
|
||||
String valStr = (val == null) ? null : val.toString();
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ final class AssocOneHelpRefExported extends AssocOneHelp {
|
||||
@Override
|
||||
void appendSelect(DbSqlContext ctx, boolean subQuery) {
|
||||
// set appropriate tableAlias for the exported id columns
|
||||
String relativePrefix = ctx.getRelativePrefix(property.getName());
|
||||
String relativePrefix = ctx.getRelativePrefix(property.name());
|
||||
ctx.pushTableAlias(relativePrefix);
|
||||
property.targetIdBinder.appendSelect(ctx, subQuery);
|
||||
ctx.popTableAlias();
|
||||
@@ -30,7 +30,7 @@ final class AssocOneHelpRefExported extends AssocOneHelp {
|
||||
|
||||
@Override
|
||||
void appendFrom(DbSqlContext ctx, SqlJoinType joinType) {
|
||||
String relativePrefix = ctx.getRelativePrefix(property.getName());
|
||||
String relativePrefix = ctx.getRelativePrefix(property.name());
|
||||
if (softDelete && !ctx.isIncludeSoftDelete()) {
|
||||
property.tableJoin.addJoin(joinType, relativePrefix, ctx, softDeletePredicate);
|
||||
} else {
|
||||
|
||||
@@ -70,7 +70,7 @@ final class AssocOneHelpRefInherit extends AssocOneHelp {
|
||||
void appendSelect(DbSqlContext ctx, boolean subQuery) {
|
||||
if (!subQuery) {
|
||||
// add discriminator column
|
||||
String relativePrefix = ctx.getRelativePrefix(property.getName());
|
||||
String relativePrefix = ctx.getRelativePrefix(property.name());
|
||||
String tableAlias = ctx.getTableAlias(relativePrefix);
|
||||
ctx.appendColumn(tableAlias, property.targetInheritInfo.getDiscriminatorColumn());
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ abstract class BaseCollectionHelp<T> implements BeanCollectionHelp<T> {
|
||||
BaseCollectionHelp(BeanPropertyAssocMany<T> many) {
|
||||
this.many = many;
|
||||
this.targetDescriptor = many.getTargetDescriptor();
|
||||
this.propertyName = many.getName();
|
||||
this.propertyName = many.name();
|
||||
}
|
||||
|
||||
BaseCollectionHelp() {
|
||||
|
||||
@@ -55,9 +55,9 @@ final class BeanChangeJson implements BeanDiffVisitor {
|
||||
stack.push(descriptor);
|
||||
BeanPropertyAssocOne<?> embedded = (BeanPropertyAssocOne<?>)descriptor.propertiesIndex[position];
|
||||
descriptor = embedded.getTargetDescriptor();
|
||||
newJson.writeStartObject(embedded.getName());
|
||||
newJson.writeStartObject(embedded.name());
|
||||
if (oldJson != null) {
|
||||
oldJson.writeStartObject(embedded.getName());
|
||||
oldJson.writeStartObject(embedded.name());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -380,8 +380,8 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
this.propertiesIndex = new BeanProperty[0];
|
||||
} else {
|
||||
EntityBeanIntercept ebi = prototypeEntityBean._ebean_getIntercept();
|
||||
this.idPropertyIndex = (idProperty == null) ? -1 : ebi.findProperty(idProperty.getName());
|
||||
this.versionPropertyIndex = (versionProperty == null) ? -1 : ebi.findProperty(versionProperty.getName());
|
||||
this.idPropertyIndex = (idProperty == null) ? -1 : ebi.findProperty(idProperty.name());
|
||||
this.versionPropertyIndex = (versionProperty == null) ? -1 : ebi.findProperty(versionProperty.name());
|
||||
this.unloadProperties = derivePropertiesToUnload(prototypeEntityBean);
|
||||
this.propertiesIndex = new BeanProperty[ebi.getPropertyLength()];
|
||||
for (int i = 0; i < propertiesIndex.length; i++) {
|
||||
@@ -913,7 +913,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
* foreign keys don't require an extra join.
|
||||
*/
|
||||
public void add(BeanFkeyProperty fkey) {
|
||||
elDeployCache.put(fkey.getName(), fkey);
|
||||
elDeployCache.put(fkey.name(), fkey);
|
||||
}
|
||||
|
||||
void initialiseFkeys() {
|
||||
@@ -1639,7 +1639,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
public BeanPropertyAssocMany<?> getManyProperty(SpiQuery<?> query) {
|
||||
OrmQueryDetail detail = query.getDetail();
|
||||
for (BeanPropertyAssocMany<?> many : propertiesMany) {
|
||||
if (detail.includesPath(many.getName())) {
|
||||
if (detail.includesPath(many.name())) {
|
||||
return many;
|
||||
}
|
||||
}
|
||||
@@ -2094,7 +2094,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
* Return the Id property name or null if no Id property exists.
|
||||
*/
|
||||
public String getIdName() {
|
||||
return (idProperty == null) ? null : idProperty.getName();
|
||||
return (idProperty == null) ? null : idProperty.name();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2220,7 +2220,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
if (!ebi.isLoadedProperty(many.getPropertyIndex())) {
|
||||
BeanCollection<?> ref = many.createReferenceIfNull(bean);
|
||||
if (ref != null && !ref.isRegisteredWithLoadContext()) {
|
||||
String path = SplitName.add(prefix, many.getName());
|
||||
String path = SplitName.add(prefix, many.name());
|
||||
loadContext.register(path, many, ref);
|
||||
}
|
||||
}
|
||||
@@ -2416,7 +2416,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
if (assocProperty != null) {
|
||||
String relativePath = assocProperty.getTargetDescriptor().findBeanPath(schemaName, tableName, columnName);
|
||||
if (relativePath != null) {
|
||||
return SplitName.add(assocProperty.getName(), relativePath);
|
||||
return SplitName.add(assocProperty.name(), relativePath);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -2825,7 +2825,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
|
||||
@Override
|
||||
public void inheritanceLoad(SqlBeanLoad sqlBeanLoad, STreeProperty property, DbReadContext ctx) {
|
||||
BeanProperty p = getBeanProperty(property.getName());
|
||||
BeanProperty p = getBeanProperty(property.name());
|
||||
if (p != null) {
|
||||
p.load(sqlBeanLoad);
|
||||
} else {
|
||||
@@ -3026,7 +3026,7 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
final Set<String> included = rootProps.getIncluded();
|
||||
if (included != null) {
|
||||
for (BeanProperty property : propertiesAggregate) {
|
||||
if (included.contains(property.getName())) {
|
||||
if (included.contains(property.name())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -3176,8 +3176,8 @@ public class BeanDescriptor<T> implements BeanType<T>, STreeType, SpiBeanType {
|
||||
* provides unique ordering of the rows (so that the paging is predicable).
|
||||
*/
|
||||
public void appendOrderById(SpiQuery<T> query) {
|
||||
if (idProperty != null && !idProperty.isEmbedded() && !query.order().containsProperty(idProperty.getName())) {
|
||||
query.order().asc(idProperty.getName());
|
||||
if (idProperty != null && !idProperty.isEmbedded() && !query.order().containsProperty(idProperty.name())) {
|
||||
query.order().asc(idProperty.name());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -282,7 +282,7 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
// held as part of the bean cache so skip
|
||||
return false;
|
||||
}
|
||||
CachedManyIds entry = manyPropGet(parentId, many.getName());
|
||||
CachedManyIds entry = manyPropGet(parentId, many.name());
|
||||
if (entry == null) {
|
||||
// not in cache so return unsuccessful
|
||||
return false;
|
||||
@@ -316,7 +316,7 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
// add as JSON to bean cache
|
||||
String asJson = many.jsonWriteCollection(details);
|
||||
Map<String, Object> changes = new HashMap<>();
|
||||
changes.put(many.getName(), asJson);
|
||||
changes.put(many.name(), asJson);
|
||||
|
||||
CachedBeanData newData = data.update(changes, data.getVersion());
|
||||
if (beanLog.isDebugEnabled()) {
|
||||
@@ -330,7 +330,7 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
} else {
|
||||
CachedManyIds entry = createManyIds(many, details);
|
||||
if (entry != null) {
|
||||
cachePutManyIds(parentId, many.getName(), entry);
|
||||
cachePutManyIds(parentId, many.name(), entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -845,7 +845,7 @@ final class BeanDescriptorCacheHelp<T> {
|
||||
Object details = many.getValue(updateRequest.entityBean());
|
||||
CachedManyIds entry = createManyIds(many, details);
|
||||
if (entry != null) {
|
||||
changeSet.addManyPut(desc, many.getName(), id, entry);
|
||||
changeSet.addManyPut(desc, many.name(), id, entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -87,12 +87,12 @@ final class BeanDescriptorDraftHelp<T> {
|
||||
void draftQueryOptimise(Query<T> query) {
|
||||
for (BeanPropertyAssocOne<?> anOne : desc.propertiesOne()) {
|
||||
if (anOne.getTargetDescriptor().isDraftableElement()) {
|
||||
query.fetch(anOne.getName());
|
||||
query.fetch(anOne.name());
|
||||
}
|
||||
}
|
||||
for (BeanPropertyAssocMany<?> aMany : desc.propertiesMany()) {
|
||||
if (aMany.getTargetDescriptor().isDraftableElement()) {
|
||||
query.fetch(aMany.getName());
|
||||
query.fetch(aMany.name());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ final class BeanEmbeddedMetaFactory {
|
||||
BeanProperty[] embeddedProperties = new BeanProperty[sourceProperties.length];
|
||||
|
||||
for (int i = 0; i < sourceProperties.length; i++) {
|
||||
String propertyName = sourceProperties[i].getName();
|
||||
String propertyName = sourceProperties[i].name();
|
||||
Column column = propColMap.get(propertyName);
|
||||
String dbColumn = dbColumn(columnPrefix, column, sourceProperties[i]);
|
||||
boolean dbNullable = dbNullable(column, sourceProperties[i]);
|
||||
|
||||
@@ -106,12 +106,12 @@ public final class BeanFkeyProperty implements ElPropertyValue {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
public String name() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getElName() {
|
||||
public String elName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ public final class BeanFkeyProperty implements ElPropertyValue {
|
||||
* Returns null as not an AssocOne.
|
||||
*/
|
||||
@Override
|
||||
public Object[] getAssocIdValues(EntityBean value) {
|
||||
public Object[] assocIdValues(EntityBean value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ public final class BeanFkeyProperty implements ElPropertyValue {
|
||||
* Returns null as not an AssocOne.
|
||||
*/
|
||||
@Override
|
||||
public String getAssocIdExpression(String prefix, String operator) {
|
||||
public String assocIdExpression(String prefix, String operator) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ public final class BeanFkeyProperty implements ElPropertyValue {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int jdbcType() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ public final class BeanFkeyProperty implements ElPropertyValue {
|
||||
}
|
||||
|
||||
@Override
|
||||
public StringParser getStringParser() {
|
||||
public StringParser stringParser() {
|
||||
throw new RuntimeException("ElPropertyDeploy only - not implemented");
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ public final class BeanFkeyProperty implements ElPropertyValue {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Property getProperty() {
|
||||
public Property property() {
|
||||
throw new RuntimeException("ElPropertyDeploy only - not implemented");
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public class BeanMapHelp<T> extends BaseCollectionHelp<T> {
|
||||
BeanMapHelp(BeanPropertyAssocMany<T> many) {
|
||||
this.many = many;
|
||||
this.targetDescriptor = many.getTargetDescriptor();
|
||||
this.propertyName = many.getName();
|
||||
this.propertyName = many.name();
|
||||
this.beanProperty = targetDescriptor.getBeanProperty(many.getMapKey());
|
||||
}
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
protected BeanProperty(BeanProperty source, BeanPropertyOverride override) {
|
||||
this.descriptor = source.descriptor;
|
||||
this.propertyIndex = source.propertyIndex;
|
||||
this.name = source.getName();
|
||||
this.name = source.name();
|
||||
this.dbColumn = override.getDbColumn();
|
||||
this.nullable = override.isDbNullable();
|
||||
this.dbLength = override.getDbLength();
|
||||
@@ -337,7 +337,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
this.dbType = source.getDbType(true);
|
||||
this.scalarType = source.scalarType;
|
||||
this.lob = isLobType(dbType);
|
||||
this.propertyType = source.getPropertyType();
|
||||
this.propertyType = source.type();
|
||||
this.field = source.getField();
|
||||
this.docOptions = source.docOptions;
|
||||
this.unmappedJson = source.unmappedJson;
|
||||
@@ -356,7 +356,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
public void initialise(BeanDescriptorInitContext initContext) {
|
||||
// do nothing for normal BeanProperty
|
||||
if (!isTransient && scalarType == null) {
|
||||
throw new RuntimeException("No ScalarType assigned to " + descriptor.fullName() + "." + getName());
|
||||
throw new RuntimeException("No ScalarType assigned to " + descriptor.fullName() + "." + name());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -572,7 +572,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Property getProperty() {
|
||||
public Property property() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -756,7 +756,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getVal(Object bean) {
|
||||
public Object value(Object bean) {
|
||||
return getValue((EntityBean) bean);
|
||||
}
|
||||
|
||||
@@ -817,7 +817,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
*/
|
||||
@Override
|
||||
@Nonnull
|
||||
public String getName() {
|
||||
public String name() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -829,7 +829,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getElName() {
|
||||
public String elName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -855,13 +855,13 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] getAssocIdValues(EntityBean bean) {
|
||||
public Object[] assocIdValues(EntityBean bean) {
|
||||
// Returns null as not an AssocOne.
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAssocIdExpression(String prefix, String operator) {
|
||||
public String assocIdExpression(String prefix, String operator) {
|
||||
// Returns null as not an AssocOne.
|
||||
return null;
|
||||
}
|
||||
@@ -939,7 +939,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
}
|
||||
|
||||
@Override
|
||||
public StringParser getStringParser() {
|
||||
public StringParser stringParser() {
|
||||
return scalarType;
|
||||
}
|
||||
|
||||
@@ -949,7 +949,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int jdbcType() {
|
||||
return scalarType == null ? 0 : scalarType.getJdbcType();
|
||||
}
|
||||
|
||||
@@ -1303,7 +1303,7 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
|
||||
*/
|
||||
@Override
|
||||
@Nonnull
|
||||
public Class<?> getPropertyType() {
|
||||
public Class<?> type() {
|
||||
return propertyType;
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
|
||||
if (childMasterProperty != null) {
|
||||
BeanProperty masterId = childMasterProperty.getTargetDescriptor().idProperty();
|
||||
if (masterId != null) { // in docstore only, the master-id may be not available
|
||||
childMasterIdProperty = childMasterProperty.getName() + "." + masterId.getName();
|
||||
childMasterIdProperty = childMasterProperty.name() + "." + masterId.name();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,7 +209,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public Collection getRawCollection(EntityBean bean) {
|
||||
return help.underlying(getVal(bean));
|
||||
return help.underlying(value(bean));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -217,11 +217,11 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
|
||||
*/
|
||||
@Override
|
||||
public void merge(EntityBean bean, EntityBean existing) {
|
||||
Object existingCollection = getVal(existing);
|
||||
Object existingCollection = value(existing);
|
||||
if (existingCollection instanceof BeanCollection<?>) {
|
||||
BeanCollection<?> toBC = (BeanCollection<?>) existingCollection;
|
||||
if (!toBC.isPopulated()) {
|
||||
Object fromCollection = getVal(bean);
|
||||
Object fromCollection = value(bean);
|
||||
if (fromCollection instanceof BeanCollection<?>) {
|
||||
BeanCollection<?> fromBC = (BeanCollection<?>) fromCollection;
|
||||
if (fromBC.isPopulated()) {
|
||||
@@ -454,7 +454,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
|
||||
* Return the Id values from the given bean.
|
||||
*/
|
||||
@Override
|
||||
public Object[] getAssocIdValues(EntityBean bean) {
|
||||
public Object[] assocIdValues(EntityBean bean) {
|
||||
return targetDescriptor.getIdBinder().getIdValues(bean);
|
||||
}
|
||||
|
||||
@@ -462,7 +462,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
|
||||
* Return the Id expression to add to where clause etc.
|
||||
*/
|
||||
@Override
|
||||
public String getAssocIdExpression(String prefix, String operator) {
|
||||
public String assocIdExpression(String prefix, String operator) {
|
||||
return targetDescriptor.getIdBinder().getAssocOneIdExpr(prefix, operator);
|
||||
}
|
||||
|
||||
@@ -702,7 +702,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
|
||||
for (BeanPropertyAssocOne<?> prop : targetDesc.propertiesOne()) {
|
||||
if (mappedBy != null) {
|
||||
// match using mappedBy as property name
|
||||
if (mappedBy.equalsIgnoreCase(prop.getName())) {
|
||||
if (mappedBy.equalsIgnoreCase(prop.name())) {
|
||||
return prop;
|
||||
}
|
||||
} else {
|
||||
@@ -723,7 +723,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> implements ST
|
||||
// search for the property
|
||||
BeanDescriptor<?> targetDesc = getTargetDescriptor();
|
||||
for (BeanProperty prop : targetDesc.propertiesAll()) {
|
||||
if (mapKey.equalsIgnoreCase(prop.getName())) {
|
||||
if (mapKey.equalsIgnoreCase(prop.name())) {
|
||||
return prop;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
|
||||
embeddedProps = overrideMeta.getProperties();
|
||||
embeddedPropsMap = new HashMap<>();
|
||||
for (BeanProperty embeddedProp : embeddedProps) {
|
||||
embeddedPropsMap.put(embeddedProp.getName(), embeddedProp);
|
||||
embeddedPropsMap.put(embeddedProp.name(), embeddedProp);
|
||||
}
|
||||
} else {
|
||||
embeddedProps = null;
|
||||
@@ -175,13 +175,13 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
|
||||
*/
|
||||
void cacheClear() {
|
||||
if (cacheNotifyRelationship) {
|
||||
targetDescriptor.cacheManyPropClear(relationshipProperty.getName());
|
||||
targetDescriptor.cacheManyPropClear(relationshipProperty.name());
|
||||
}
|
||||
}
|
||||
|
||||
void cacheClear(CacheChangeSet changeSet) {
|
||||
if (cacheNotifyRelationship) {
|
||||
changeSet.addManyClear(targetDescriptor, relationshipProperty.getName());
|
||||
changeSet.addManyClear(targetDescriptor, relationshipProperty.name());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,13 +191,13 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
|
||||
void cacheDelete(boolean clear, EntityBean bean, CacheChangeSet changeSet) {
|
||||
if (cacheNotifyRelationship) {
|
||||
if (clear) {
|
||||
changeSet.addManyClear(targetDescriptor, relationshipProperty.getName());
|
||||
changeSet.addManyClear(targetDescriptor, relationshipProperty.name());
|
||||
} else {
|
||||
Object assocBean = getValue(bean);
|
||||
if (assocBean != null) {
|
||||
Object parentId = targetDescriptor.id(assocBean);
|
||||
if (parentId != null) {
|
||||
changeSet.addManyRemove(targetDescriptor, relationshipProperty.getName(), parentId);
|
||||
changeSet.addManyRemove(targetDescriptor, relationshipProperty.name(), parentId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -268,7 +268,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
|
||||
private List<Object> findIdsByParentId(Object parentId, Transaction t) {
|
||||
String rawWhere = deriveWhereParentIdSql(false);
|
||||
SpiEbeanServer server = server();
|
||||
Query<?> q = server.find(getPropertyType());
|
||||
Query<?> q = server.find(type());
|
||||
bindParentIdEq(rawWhere, parentId, q);
|
||||
return server.findIds(q, t);
|
||||
}
|
||||
@@ -278,7 +278,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
|
||||
String inClause = getIdBinder().getIdInValueExpr(false, parentIds.size());
|
||||
String expr = rawWhere + inClause;
|
||||
SpiEbeanServer server = server();
|
||||
Query<?> q = server.find(getPropertyType());
|
||||
Query<?> q = server.find(type());
|
||||
bindParentIdsIn(expr, parentIds, q);
|
||||
return server.findIds(q, t);
|
||||
}
|
||||
@@ -301,7 +301,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
|
||||
String basePath = SplitName.add(prefix, name);
|
||||
if (dbColumn != null) {
|
||||
BeanProperty idProperty = target.idProperty();
|
||||
desc.registerColumn(dbColumn, SplitName.add(basePath, idProperty.getName()));
|
||||
desc.registerColumn(dbColumn, SplitName.add(basePath, idProperty.name()));
|
||||
}
|
||||
desc.registerTable(target.baseTable(), this);
|
||||
}
|
||||
@@ -399,7 +399,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getTargetType() {
|
||||
return getPropertyType();
|
||||
return type();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -485,7 +485,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
|
||||
* Return the Id values from the given bean.
|
||||
*/
|
||||
@Override
|
||||
public Object[] getAssocIdValues(EntityBean bean) {
|
||||
public Object[] assocIdValues(EntityBean bean) {
|
||||
return targetDescriptor.getIdBinder().getIdValues(bean);
|
||||
}
|
||||
|
||||
@@ -493,7 +493,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
|
||||
* Return the Id expression to add to where clause etc.
|
||||
*/
|
||||
@Override
|
||||
public String getAssocIdExpression(String prefix, String operator) {
|
||||
public String assocIdExpression(String prefix, String operator) {
|
||||
return targetDescriptor.getIdBinder().getAssocOneIdExpr(prefix, operator);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ abstract class DynamicPropertyBase implements STreeProperty {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
public String name() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,6 @@ final class ExportedProperty {
|
||||
if (path != null) {
|
||||
sb.append(path).append(".");
|
||||
}
|
||||
sb.append(property.getName());
|
||||
sb.append(property.name());
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ public final class IdBinderEmbedded implements IdBinder {
|
||||
public IdBinderEmbedded(boolean idInExpandedForm, BeanPropertyAssocOne<?> embIdProperty) {
|
||||
this.idInExpandedForm = idInExpandedForm;
|
||||
this.embIdProperty = embIdProperty;
|
||||
this.idClass = "_idClass".equals(embIdProperty.getName());
|
||||
this.idClass = "_idClass".equals(embIdProperty.name());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -91,9 +91,9 @@ public final class IdBinderEmbedded implements IdBinder {
|
||||
sb.append(pathPrefix).append(".");
|
||||
}
|
||||
if (!idClass) {
|
||||
sb.append(embIdProperty.getName()).append(".");
|
||||
sb.append(embIdProperty.name()).append(".");
|
||||
}
|
||||
sb.append(props[i].getName());
|
||||
sb.append(props[i].name());
|
||||
if (!ascending) {
|
||||
sb.append(" desc");
|
||||
}
|
||||
@@ -107,13 +107,13 @@ public final class IdBinderEmbedded implements IdBinder {
|
||||
|
||||
@Override
|
||||
public String getIdProperty() {
|
||||
return embIdProperty.getName();
|
||||
return embIdProperty.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildRawSqlSelectChain(String prefix, List<String> selectChain) {
|
||||
if (!idClass) {
|
||||
prefix = SplitName.add(prefix, embIdProperty.getName());
|
||||
prefix = SplitName.add(prefix, embIdProperty.name());
|
||||
}
|
||||
for (BeanProperty prop : props) {
|
||||
prop.buildRawSqlSelectChain(prefix, selectChain);
|
||||
@@ -143,9 +143,9 @@ public final class IdBinderEmbedded implements IdBinder {
|
||||
sb.append(", ");
|
||||
}
|
||||
if (!idClass) {
|
||||
sb.append(embIdProperty.getName()).append(".");
|
||||
sb.append(embIdProperty.name()).append(".");
|
||||
}
|
||||
sb.append(props[i].getName());
|
||||
sb.append(props[i].name());
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
@@ -235,7 +235,7 @@ public final class IdBinderEmbedded implements IdBinder {
|
||||
EntityBean ebValue = (EntityBean) embIdProperty.getValue(bean);
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
for (BeanProperty prop : props) {
|
||||
map.put(prop.getName(), prop.getValue(ebValue));
|
||||
map.put(prop.name(), prop.getValue(ebValue));
|
||||
}
|
||||
return map;
|
||||
}
|
||||
@@ -249,7 +249,7 @@ public final class IdBinderEmbedded implements IdBinder {
|
||||
Map<String, Object> map = (Map<String, Object>) value;
|
||||
EntityBean idValue = idDesc.createEntityBean();
|
||||
for (BeanProperty prop : props) {
|
||||
prop.setValue(idValue, map.get(prop.getName()));
|
||||
prop.setValue(idValue, map.get(prop.name()));
|
||||
}
|
||||
return idValue;
|
||||
}
|
||||
@@ -358,7 +358,7 @@ public final class IdBinderEmbedded implements IdBinder {
|
||||
if (prefix != null) {
|
||||
sb.append(prefix).append(".");
|
||||
}
|
||||
sb.append(props[i].getName());
|
||||
sb.append(props[i].name());
|
||||
}
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
@@ -375,9 +375,9 @@ public final class IdBinderEmbedded implements IdBinder {
|
||||
sb.append(prefix).append(".");
|
||||
}
|
||||
if (!idClass) {
|
||||
sb.append(embIdProperty.getName()).append(".");
|
||||
sb.append(embIdProperty.name()).append(".");
|
||||
}
|
||||
sb.append(props[i].getName()).append(operator);
|
||||
sb.append(props[i].name()).append(operator);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public final class IdBinderSimple implements IdBinder {
|
||||
public IdBinderSimple(BeanProperty idProperty, MultiValueBind multiValueBind) {
|
||||
this.idProperty = idProperty;
|
||||
this.scalarType = idProperty.getScalarType();
|
||||
this.expectedType = idProperty.getPropertyType();
|
||||
this.expectedType = idProperty.type();
|
||||
bindIdSql = InternString.intern(idProperty.getDbColumn() + " = ? ");
|
||||
this.multiValueBind = multiValueBind;
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public final class IdBinderSimple implements IdBinder {
|
||||
if (pathPrefix != null) {
|
||||
sb.append(pathPrefix).append(".");
|
||||
}
|
||||
sb.append(idProperty.getName());
|
||||
sb.append(idProperty.name());
|
||||
if (!ascending) {
|
||||
sb.append(" desc");
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public final class IdBinderSimple implements IdBinder {
|
||||
|
||||
@Override
|
||||
public String getIdProperty() {
|
||||
return idProperty.getName();
|
||||
return idProperty.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -93,7 +93,7 @@ public final class IdBinderSimple implements IdBinder {
|
||||
|
||||
@Override
|
||||
public String getDefaultOrderBy() {
|
||||
return idProperty.getName();
|
||||
return idProperty.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -216,7 +216,7 @@ public final class IdBinderSimple implements IdBinder {
|
||||
sb.append(prefix);
|
||||
sb.append(".");
|
||||
}
|
||||
sb.append(idProperty.getName());
|
||||
sb.append(idProperty.name());
|
||||
sb.append(operator);
|
||||
return sb.toString();
|
||||
}
|
||||
@@ -228,7 +228,7 @@ public final class IdBinderSimple implements IdBinder {
|
||||
sb.append(prefix);
|
||||
sb.append(".");
|
||||
}
|
||||
sb.append(idProperty.getName());
|
||||
sb.append(idProperty.name());
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public final class ImportedIdEmbedded implements ImportedId {
|
||||
public void addFkeys(String name) {
|
||||
BeanProperty[] embeddedProps = foreignAssocOne.getProperties();
|
||||
for (int i = 0; i < imported.length; i++) {
|
||||
String n = name + "." + foreignAssocOne.getName() + "." + embeddedProps[i].getName();
|
||||
String n = name + "." + foreignAssocOne.name() + "." + embeddedProps[i].name();
|
||||
BeanFkeyProperty fkey = new BeanFkeyProperty(n, imported[i].localDbColumn, foreignAssocOne.getDeployOrder());
|
||||
owner.getBeanDescriptor().add(fkey);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ public final class ImportedIdSimple implements ImportedId, Comparable<ImportedId
|
||||
|
||||
@Override
|
||||
public void addFkeys(String name) {
|
||||
BeanFkeyProperty fkey = new BeanFkeyProperty(name + "." + foreignProperty.getName(), localDbColumn, owner.getDeployOrder());
|
||||
BeanFkeyProperty fkey = new BeanFkeyProperty(name + "." + foreignProperty.name(), localDbColumn, owner.getDeployOrder());
|
||||
owner.getBeanDescriptor().add(fkey);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -90,7 +90,7 @@ public final class DeployBeanPropertyLists {
|
||||
discProperty = null;
|
||||
}
|
||||
BeanProperty beanProp = createBeanProperty(owner, prop);
|
||||
propertyMap.put(beanProp.getName(), beanProp);
|
||||
propertyMap.put(beanProp.name(), beanProp);
|
||||
}
|
||||
|
||||
int order = 0;
|
||||
@@ -102,13 +102,13 @@ public final class DeployBeanPropertyLists {
|
||||
if (orderColumn != null) {
|
||||
orderColumn.setDeployOrder(order);
|
||||
allocateToList(orderColumn);
|
||||
propertyMap.put(orderColumn.getName(), orderColumn);
|
||||
propertyMap.put(orderColumn.name(), orderColumn);
|
||||
}
|
||||
|
||||
if (discProperty != null) {
|
||||
// put the discriminator property into the property map only
|
||||
// (after the real properties have been organised into their lists)
|
||||
propertyMap.put(discProperty.getName(), discProperty);
|
||||
propertyMap.put(discProperty.name(), discProperty);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -198,7 +198,7 @@ final class AnnotationAssocManys extends AnnotationAssoc {
|
||||
BeanProperty localId = localTable.getIdProperty();
|
||||
if (localId != null) {
|
||||
// add foreign key based on convention
|
||||
String fkColName = namingConvention.getForeignKey(descriptor.getBaseTable(), localId.getName());
|
||||
String fkColName = namingConvention.getForeignKey(descriptor.getBaseTable(), localId.name());
|
||||
prop.getTableJoin().addJoinColumn(new DeployTableJoinColumn(localId.getDbColumn(), fkColName));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,13 +43,13 @@ public final class ElComparatorProperty<T> implements Comparator<T>, ElComparato
|
||||
return val2 == null ? 0 : nullOrder;
|
||||
}
|
||||
if (elGetValue.isAssocId()) {
|
||||
val1 = elGetValue.getAssocIdValues((EntityBean) val1)[0]; // TODO: compound key not yet supported
|
||||
val1 = elGetValue.assocIdValues((EntityBean) val1)[0]; // TODO: compound key not yet supported
|
||||
}
|
||||
if (val2 == null) {
|
||||
return -1 * nullOrder;
|
||||
}
|
||||
if (elGetValue.isAssocId()) {
|
||||
val2 = elGetValue.getAssocIdValues((EntityBean) val2)[0];
|
||||
val2 = elGetValue.assocIdValues((EntityBean) val2)[0];
|
||||
}
|
||||
Comparable c = (Comparable) val1;
|
||||
return asc * c.compareTo(val2);
|
||||
|
||||
@@ -136,12 +136,12 @@ public final class ElPropertyChain implements ElPropertyValue {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
public String name() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getElName() {
|
||||
public String elName() {
|
||||
return expression;
|
||||
}
|
||||
|
||||
@@ -171,15 +171,15 @@ public final class ElPropertyChain implements ElPropertyValue {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] getAssocIdValues(EntityBean bean) {
|
||||
public Object[] assocIdValues(EntityBean bean) {
|
||||
// Don't navigate the object graph as bean
|
||||
// is assumed to be the appropriate type
|
||||
return lastElPropertyValue.getAssocIdValues(bean);
|
||||
return lastElPropertyValue.assocIdValues(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAssocIdExpression(String prefix, String operator) {
|
||||
return lastElPropertyValue.getAssocIdExpression(expression, operator);
|
||||
public String assocIdExpression(String prefix, String operator) {
|
||||
return lastElPropertyValue.assocIdExpression(expression, operator);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -198,7 +198,7 @@ public final class ElPropertyChain implements ElPropertyValue {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Property getProperty() {
|
||||
public Property property() {
|
||||
return lastBeanProperty;
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ public final class ElPropertyChain implements ElPropertyValue {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getJdbcType() {
|
||||
public int jdbcType() {
|
||||
return scalarType == null ? 0 : scalarType.getJdbcType();
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ public final class ElPropertyChain implements ElPropertyValue {
|
||||
}
|
||||
|
||||
@Override
|
||||
public StringParser getStringParser() {
|
||||
public StringParser stringParser() {
|
||||
return scalarType;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,12 +53,12 @@ public interface ElPropertyDeploy {
|
||||
/**
|
||||
* Return the name of the property.
|
||||
*/
|
||||
String getName();
|
||||
String name();
|
||||
|
||||
/**
|
||||
* The ElPrefix plus name.
|
||||
*/
|
||||
String getElName();
|
||||
String elName();
|
||||
|
||||
/**
|
||||
* Return the deployment db column for this property.
|
||||
|
||||
+1
-1
@@ -276,7 +276,7 @@ final class DefaultExampleExpression implements SpiExpression, ExampleExpression
|
||||
if (!beanProperty.isTransient()) {
|
||||
Object value = beanProperty.getValue(bean);
|
||||
if (value != null) {
|
||||
String propName = SplitName.add(prefix, beanProperty.getName());
|
||||
String propName = SplitName.add(prefix, beanProperty.name());
|
||||
if (beanProperty.isScalar()) {
|
||||
if (value instanceof String) {
|
||||
list.add(new LikeExpression(propName, value, caseInsensitive, likeType));
|
||||
|
||||
@@ -113,7 +113,7 @@ public final class IdInExpression extends NonPrepareExpression {
|
||||
request.append(descriptor.getIdBinderInLHSSql());
|
||||
request.append(idBinder.getIdInValueExpr(false, idCollection.size()));
|
||||
} else {
|
||||
request.append(idBinder.getBeanProperty().getName());
|
||||
request.append(idBinder.getBeanProperty().name());
|
||||
request.appendInExpression(false, idCollection);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ final class InExpression extends AbstractExpression {
|
||||
List<Object> idList = new ArrayList<>();
|
||||
for (Object bindValue : bindValues) {
|
||||
// extract the id values from the bean
|
||||
Object[] ids = prop.getAssocIdValues((EntityBean) bindValue);
|
||||
Object[] ids = prop.assocIdValues((EntityBean) bindValue);
|
||||
if (ids != null) {
|
||||
Collections.addAll(idList, ids);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ final class NullExpression extends AbstractExpression {
|
||||
|
||||
String nullExpr = notNull ? " is not null" : " is null";
|
||||
if (elProperty != null && elProperty.isAssocId()) {
|
||||
request.append(elProperty.getAssocIdExpression(propName, nullExpr));
|
||||
request.append(elProperty.assocIdExpression(propName, nullExpr));
|
||||
} else {
|
||||
request.append(propName).append(nullExpr);
|
||||
}
|
||||
|
||||
@@ -44,8 +44,8 @@ public final class SimpleExpression extends AbstractValueExpression {
|
||||
}
|
||||
ExpressionPath prop = context.getExpressionPath(propName);
|
||||
if (prop != null && prop.isAssocId()) {
|
||||
String idName = prop.getAssocIdExpression(propName, "");
|
||||
Object[] ids = prop.getAssocIdValues((EntityBean) value());
|
||||
String idName = prop.assocIdExpression(propName, "");
|
||||
Object[] ids = prop.assocIdValues((EntityBean) value());
|
||||
if (ids == null || ids.length != 1) {
|
||||
throw new IllegalArgumentException("Expecting 1 Id value for " + idName + " but got " + Arrays.toString(ids));
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public final class SimpleExpression extends AbstractValueExpression {
|
||||
ElPropertyValue prop = getElProp(request);
|
||||
if (prop != null) {
|
||||
if (prop.isAssocId()) {
|
||||
Object[] ids = prop.getAssocIdValues((EntityBean) value());
|
||||
Object[] ids = prop.assocIdValues((EntityBean) value());
|
||||
if (ids != null) {
|
||||
for (Object id : ids) {
|
||||
request.addBindValue(id);
|
||||
@@ -101,7 +101,7 @@ public final class SimpleExpression extends AbstractValueExpression {
|
||||
ElPropertyValue prop = getElProp(request);
|
||||
if (prop != null) {
|
||||
if (prop.isAssocId()) {
|
||||
request.append(prop.getAssocIdExpression(propName, type.bind()));
|
||||
request.append(prop.assocIdExpression(propName, type.bind()));
|
||||
return;
|
||||
}
|
||||
if (prop.isDbEncrypted()) {
|
||||
|
||||
@@ -39,7 +39,7 @@ final class DLoadBeanContext extends DLoadBaseContext implements LoadBeanContext
|
||||
|
||||
@Override
|
||||
public void register(BeanPropertyAssocMany<?> many, BeanCollection<?> collection) {
|
||||
String path = fullPath + "." + many.getName();
|
||||
String path = fullPath + "." + many.name();
|
||||
parent.register(path, many, collection);
|
||||
}
|
||||
|
||||
|
||||
@@ -846,7 +846,7 @@ public final class DefaultPersister implements Persister {
|
||||
Query<?> q = server.createQuery(desc.type());
|
||||
StringBuilder sb = new StringBuilder(30);
|
||||
for (BeanPropertyAssocOne<?> aPropImportDelete : propImportDelete) {
|
||||
sb.append(aPropImportDelete.getName()).append(",");
|
||||
sb.append(aPropImportDelete.name()).append(",");
|
||||
}
|
||||
q.setAutoTune(false);
|
||||
q.select(sb.toString());
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ final class DeleteUnloadedForeignKeys {
|
||||
|
||||
StringBuilder sb = new StringBuilder(30);
|
||||
for (BeanPropertyAssocOne<?> aPropList : propList) {
|
||||
sb.append(aPropList.getName()).append(",");
|
||||
sb.append(aPropList.name()).append(",");
|
||||
}
|
||||
|
||||
// run query in a separate persistence context
|
||||
|
||||
@@ -86,7 +86,7 @@ final class MergeHandler {
|
||||
query.setBeanCacheMode(CacheMode.OFF);
|
||||
query.setPersistenceContextScope(PersistenceContextScope.QUERY);
|
||||
query.setId(desc.getId(bean));
|
||||
query.select(desc.idProperty().getName());
|
||||
query.select(desc.idProperty().name());
|
||||
|
||||
for (String path : paths) {
|
||||
MergeNode node = buildNode(path);
|
||||
|
||||
@@ -72,7 +72,7 @@ abstract class MergeNode {
|
||||
*/
|
||||
final void addSelectId(Query<?> query) {
|
||||
BeanProperty idProperty = targetDescriptor.idProperty();
|
||||
query.fetch(fullPath, idProperty.getName());
|
||||
query.fetch(fullPath, idProperty.name());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -55,6 +55,6 @@ final class MergeNodeAssocOne extends MergeNode {
|
||||
}
|
||||
|
||||
private EntityBean getEntityBean(Object bean) {
|
||||
return (EntityBean) one.getVal(bean);
|
||||
return (EntityBean) one.value(bean);
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ abstract class SaveManyBase implements SaveMany {
|
||||
if (request.isNotifyCache()) {
|
||||
try {
|
||||
String asJson = many.jsonWriteCollection(value);
|
||||
request.addCollectionChange(many.getName(), asJson);
|
||||
request.addCollectionChange(many.name(), asJson);
|
||||
} catch (IOException e) {
|
||||
log.error("Error build element collection entry for L2 cache", e);
|
||||
}
|
||||
|
||||
+2
-2
@@ -64,13 +64,13 @@ final class BindableEncryptedProperty implements Bindable {
|
||||
|
||||
if (!bindEncryptDataFirst) {
|
||||
// H2 encrypt function ... different parameter order
|
||||
request.bindNoLog(encryptKeyValue, Types.VARCHAR, prop.getName() + "=****");
|
||||
request.bindNoLog(encryptKeyValue, Types.VARCHAR, prop.name() + "=****");
|
||||
}
|
||||
request.bindNoLog(value, prop);
|
||||
|
||||
if (bindEncryptDataFirst) {
|
||||
// MySql, Postgres, Oracle
|
||||
request.bindNoLog(encryptKeyValue, Types.VARCHAR, prop.getName() + "=****");
|
||||
request.bindNoLog(encryptKeyValue, Types.VARCHAR, prop.name() + "=****");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -585,7 +585,7 @@ public final class CQuery<T> implements DbReadContext, CancelableQuery, SpiProfi
|
||||
|
||||
@Override
|
||||
public void registerBeanInherit(BeanPropertyAssocOne<?> property, EntityBeanIntercept ebi) {
|
||||
String path = getPath(property.getName());
|
||||
String path = getPath(property.name());
|
||||
request.loadContext().register(path, ebi, property);
|
||||
}
|
||||
|
||||
@@ -597,7 +597,7 @@ public final class CQuery<T> implements DbReadContext, CancelableQuery, SpiProfi
|
||||
|
||||
@Override
|
||||
public void register(BeanPropertyAssocMany<?> many, BeanCollection<?> bc) {
|
||||
String path = getPath(many.getName());
|
||||
String path = getPath(many.name());
|
||||
request.loadContext().register(path, many, bc);
|
||||
}
|
||||
|
||||
|
||||
@@ -479,7 +479,7 @@ final class CQueryBuilder {
|
||||
// check if @Id property included in RawSql
|
||||
boolean rawNoId = true;
|
||||
BeanProperty idProperty = descriptor.idProperty();
|
||||
if (idProperty != null && columnMapping.contains(idProperty.getName())) {
|
||||
if (idProperty != null && columnMapping.contains(idProperty.name())) {
|
||||
// contains the @Id property for the root level bean
|
||||
rawNoId = false;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ final class CQueryOrderBy {
|
||||
if (beanProperty instanceof BeanPropertyAssoc<?>) {
|
||||
BeanPropertyAssoc<?> ap = (BeanPropertyAssoc<?>) beanProperty;
|
||||
IdBinder idBinder = ap.getTargetDescriptor().getIdBinder();
|
||||
return idBinder.getOrderBy(el.getElName(), p.isAscending());
|
||||
return idBinder.getOrderBy(el.elName(), p.isAscending());
|
||||
}
|
||||
|
||||
return p.toStringFormat();
|
||||
|
||||
@@ -212,7 +212,7 @@ public final class CQueryPredicates {
|
||||
|
||||
BeanPropertyAssocMany<?> manyProperty = request.determineMany();
|
||||
if (manyProperty != null) {
|
||||
OrmQueryProperties chunk = query.getDetail().getChunk(manyProperty.getName(), false);
|
||||
OrmQueryProperties chunk = query.getDetail().getChunk(manyProperty.name(), false);
|
||||
SpiExpressionList<?> filterManyExpr = chunk.getFilterMany();
|
||||
if (filterManyExpr != null) {
|
||||
this.filterMany = new DefaultExpressionRequest(request, deployParser, binder, filterManyExpr);
|
||||
@@ -337,7 +337,7 @@ public final class CQueryPredicates {
|
||||
// check for default ordering on the many property...
|
||||
String manyOrderBy = manyProp.getFetchOrderBy();
|
||||
if (manyOrderBy != null) {
|
||||
orderBy = orderBy + ", " + CQueryBuilder.prefixOrderByFields(manyProp.getName(), manyOrderBy);
|
||||
orderBy = orderBy + ", " + CQueryBuilder.prefixOrderByFields(manyProp.name(), manyOrderBy);
|
||||
}
|
||||
|
||||
if (request.isFindById()) {
|
||||
@@ -353,7 +353,7 @@ public final class CQueryPredicates {
|
||||
// we need to make sure their is an order by on the
|
||||
// top level first (to ensure master/detail construction).
|
||||
|
||||
int manyPos = orderBy.indexOf(manyProp.getName());
|
||||
int manyPos = orderBy.indexOf(manyProp.name());
|
||||
int idPos = orderBy.indexOf(" " + orderById);
|
||||
|
||||
if (manyPos == -1) {
|
||||
@@ -370,9 +370,9 @@ public final class CQueryPredicates {
|
||||
if (idPos <= -1 || idPos >= manyPos) {
|
||||
if (idPos > manyPos) {
|
||||
// there was an error with the order by...
|
||||
String msg = "A Query on [" + desc + "] includes a join to a 'many' association [" + manyProp.getName();
|
||||
String msg = "A Query on [" + desc + "] includes a join to a 'many' association [" + manyProp.name();
|
||||
msg += "] with an incorrect orderBy [" + orderBy + "]. The id property [" + orderById + "]";
|
||||
msg += " must come before the many property [" + manyProp.getName() + "] in the orderBy.";
|
||||
msg += " must come before the many property [" + manyProp.name() + "] in the orderBy.";
|
||||
msg += " Ebean has automatically modified the orderBy clause to do this.";
|
||||
|
||||
logger.warn(msg);
|
||||
|
||||
@@ -17,7 +17,7 @@ public interface STreeProperty extends ScalarDataReader<Object> {
|
||||
/**
|
||||
* Return the property name.
|
||||
*/
|
||||
String getName();
|
||||
String name();
|
||||
|
||||
/**
|
||||
* Return the full property name (for error messages).
|
||||
|
||||
@@ -226,7 +226,7 @@ public final class SqlTreeBuilder {
|
||||
List<SqlTreeNode> myJoinList = new ArrayList<>();
|
||||
List<STreePropertyAssocOne> extraProps = new ArrayList<>();
|
||||
for (STreePropertyAssocOne one : desc.propsOne()) {
|
||||
String propPrefix = SplitName.add(prefix, one.getName());
|
||||
String propPrefix = SplitName.add(prefix, one.name());
|
||||
if (isIncludeBean(propPrefix)) {
|
||||
selectIncludes.add(propPrefix);
|
||||
if (!one.hasForeignKey()) {
|
||||
@@ -237,7 +237,7 @@ public final class SqlTreeBuilder {
|
||||
}
|
||||
|
||||
for (STreePropertyAssocMany many : desc.propsMany()) {
|
||||
String propPrefix = SplitName.add(prefix, many.getName());
|
||||
String propPrefix = SplitName.add(prefix, many.name());
|
||||
if (isIncludeMany(propPrefix, many)) {
|
||||
selectIncludes.add(propPrefix);
|
||||
buildSelectChain(propPrefix, many, many.target(), myJoinList);
|
||||
@@ -413,7 +413,7 @@ public final class SqlTreeBuilder {
|
||||
} else {
|
||||
logger.error("property [" + propName + "] not found on " + desc + " for query - excluding it.");
|
||||
}
|
||||
} else if (p.isEmbedded() || (p instanceof STreePropertyAssoc && !queryProps.isIncludedBeanJoin(p.getName()))) {
|
||||
} else if (p.isEmbedded() || (p instanceof STreePropertyAssoc && !queryProps.isIncludedBeanJoin(p.name()))) {
|
||||
// add the embedded bean or the *ToOne assoc bean. We skip the check that the *ToOne propName maps to Id property ...
|
||||
selectProps.add(p);
|
||||
} else {
|
||||
@@ -440,7 +440,7 @@ public final class SqlTreeBuilder {
|
||||
// included as a bean join. With a bean join
|
||||
// the property should be excluded as the bean
|
||||
// join has its own node in the SqlTree.
|
||||
if (!queryProps.isIncludedBeanJoin(p.getName())) {
|
||||
if (!queryProps.isIncludedBeanJoin(p.name())) {
|
||||
// include the property... which basically
|
||||
// means include the foreign key column(s)
|
||||
selectProps.add(p);
|
||||
@@ -497,7 +497,7 @@ public final class SqlTreeBuilder {
|
||||
for (STreePropertyAssocOne propertyAssocOne : desc.propsOne()) {
|
||||
//noinspection StatementWithEmptyBody
|
||||
if (queryProps != null
|
||||
&& queryProps.isIncludedBeanJoin(propertyAssocOne.getName())
|
||||
&& queryProps.isIncludedBeanJoin(propertyAssocOne.name())
|
||||
&& propertyAssocOne.hasForeignKey()
|
||||
&& !propertyAssocOne.isFormula()) {
|
||||
// if it is a joined bean with FK constraint... then don't add the property
|
||||
|
||||
@@ -139,7 +139,7 @@ class SqlTreeNodeBean implements SqlTreeNode {
|
||||
private Map<String, String> createPathMap(String prefix, STreeType desc) {
|
||||
HashMap<String, String> m = new HashMap<>();
|
||||
for (STreePropertyAssocMany many : desc.propsMany()) {
|
||||
String name = many.getName();
|
||||
String name = many.name();
|
||||
m.put(name, getPath(prefix, name));
|
||||
}
|
||||
return m;
|
||||
|
||||
@@ -35,7 +35,7 @@ public final class SqlTreeProperties {
|
||||
|
||||
public void add(STreeProperty prop) {
|
||||
propsList.add(prop);
|
||||
propNames.add(prop.getName());
|
||||
propNames.add(prop.name());
|
||||
if (prop.isAggregation()) {
|
||||
if (!aggregation) {
|
||||
aggregation = true;
|
||||
|
||||
@@ -129,7 +129,7 @@ public class TCsvReader<T> implements CsvReader<T> {
|
||||
throw new TextException("Property " + propertyName + " is not DateTime capable");
|
||||
}
|
||||
if (dateTimeFormat == null) {
|
||||
dateTimeFormat = getDefaultDateTimeFormat(elProp.getJdbcType());
|
||||
dateTimeFormat = getDefaultDateTimeFormat(elProp.jdbcType());
|
||||
}
|
||||
|
||||
if (locale == null) {
|
||||
@@ -162,7 +162,7 @@ public class TCsvReader<T> implements CsvReader<T> {
|
||||
|
||||
ExpressionPath elProp = descriptor.expressionPath(propertyName);
|
||||
if (parser == null) {
|
||||
parser = elProp.getStringParser();
|
||||
parser = elProp.stringParser();
|
||||
}
|
||||
CsvColumn column = new CsvColumn(elProp, parser);
|
||||
columnList.add(column);
|
||||
@@ -240,10 +240,10 @@ public class TCsvReader<T> implements CsvReader<T> {
|
||||
throw new TextException("Property [" + aLine + "] not found");
|
||||
}
|
||||
|
||||
if (Types.TIME == elProp.getJdbcType()) {
|
||||
if (Types.TIME == elProp.jdbcType()) {
|
||||
addProperty(aLine, TIME_PARSER);
|
||||
|
||||
} else if (isDateTimeType(elProp.getJdbcType())) {
|
||||
} else if (isDateTimeType(elProp.jdbcType())) {
|
||||
addDateTime(aLine, null, null);
|
||||
|
||||
} else if (elProp.isAssocProperty()) {
|
||||
|
||||
@@ -506,7 +506,7 @@ public final class WriteJson implements SpiJsonWriter {
|
||||
return true;
|
||||
if (currentIncludeProps != null) {
|
||||
// explicitly controlled by pathProperties
|
||||
return currentIncludeProps.contains(prop.getName());
|
||||
return currentIncludeProps.contains(prop.name());
|
||||
} else {
|
||||
// include only loaded properties
|
||||
return currentBean._ebean_getIntercept().isLoadedProperty(prop.getPropertyIndex());
|
||||
@@ -518,7 +518,7 @@ public final class WriteJson implements SpiJsonWriter {
|
||||
return false;
|
||||
} else if (!explicitAllProps && currentIncludeProps != null) {
|
||||
// explicitly controlled by pathProperties
|
||||
return currentIncludeProps.contains(prop.getName());
|
||||
return currentIncludeProps.contains(prop.name());
|
||||
} else {
|
||||
// by default include transient properties
|
||||
return true;
|
||||
|
||||
+1
-1
@@ -178,7 +178,7 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
|
||||
BeanProperty idProperty = targetDesc.idProperty();
|
||||
if (idProperty != null) {
|
||||
// embedded beans don't have id property
|
||||
String fullPath = path + "." + idProperty.getName();
|
||||
String fullPath = path + "." + idProperty.name();
|
||||
targetDesc.docStoreAdapter().registerInvalidationPath(desc.docStoreQueueId(), fullPath, pathProp.getProperties());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class DocStructure {
|
||||
BeanDescriptor<?> targetDesc = embProp.getTargetDescriptor();
|
||||
|
||||
PathProperties manyRootPath = new PathProperties();
|
||||
manyRootPath.addToPath(null, targetDesc.idProperty().getName());
|
||||
manyRootPath.addToPath(null, targetDesc.idProperty().name());
|
||||
manyRootPath.addNested(prop, embedded.get(prop));
|
||||
|
||||
manyRoot.put(prop, manyRootPath);
|
||||
|
||||
Reference in new issue
Block a user