Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

need @NoSqlIndexed(byKeyOnly=true) #44

Open
deanhiller opened this Issue · 1 comment

1 participant

@deanhiller
Owner

I keep needing this so I am finally adding the issue in here.....

I need a property byKeyOnly so when we have a class like this

private UserDbo {

@NoSqlId
private String id;

@NoSqlIndexed(byKeyOnly=true)
 private String email;

}

where this will create the typical UserDbo table BUT instead of creating a normal index, it will create a table called emailToUserDbo such that I can do a JPA call of query="select u from TABLE as u where u.email = :email" BUT this query ONLY does = and does not < nor > or anything else.

Updating this is also interesting as if email changes you must delete the previous row in the xref table.

The emailToUserDbo table is very simple...one key=email and one column with name="value" and value="user row key"

It is VERY important that an index is NOT used as this pattern scales to trillions of UserDbo's where using an index does not

later,
Dean

@deanhiller
Owner

actually, allow the user to specify the column name to use as in my case, I am using the column name userkey and others most likely have tables like this as they are useful in some situations. The default should "" and if the default is used, then just use value as the column name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.