Package com.alvazan.orm.api.z8spi.meta

Examples of com.alvazan.orm.api.z8spi.meta.DboColumnToOneMeta


    }
    else {
      Object value = column.getValue();
      DboColumnMeta colMeta = data.getColumnMeta();
      if (value == null && colMeta instanceof DboColumnToOneMeta) {
        DboColumnToOneMeta one = (DboColumnToOneMeta) colMeta;
        value = one.convertFromStorage2(column.getCompositeSubName());
      }
      if(!valuesEqual(pt.getIndexedValue(), value)) {
        System.out.println("Entity with rowkey="+pt.getKeyAsString()+" has extra incorrect index point with value="+pt.getIndexedValueAsString()+" correct value should be= "+value);
        s.removeIndexPoint(pt, data.getPartitionBy(), data.getPartitionId());
        IndexColumn col = new IndexColumn();
View Full Code Here


   
    DboTableMeta meta = new DboTableMeta();
    meta.setup("MyRaceCar", "ourstuff", false, false);
    DboColumnIdMeta idMeta = new DboColumnIdMeta();
    idMeta.setup(meta, "id", String.class, true);
    DboColumnToOneMeta toOne = new DboColumnToOneMeta();
    toOne.setup(meta, "carOwner", fkToTable, false, false);
   
    mgr.put(meta);
    mgr.put(idMeta);
    mgr.put(toOne);
    mgr.flush();
View Full Code Here

    NoSqlEntityManager mgr = factory.createEntityManager();

    DboDatabaseMeta database = mgr.find(DboDatabaseMeta.class, DboDatabaseMeta.META_DB_ROWKEY);
    DboTableMeta table = database.getMeta("Activity");
    DboColumnMeta columnMeta = table.getColumnMeta("account");
    DboColumnToOneMeta toOne = (DboColumnToOneMeta) columnMeta;
    Assert.assertEquals("id", toOne.getFkToColumnFamily().getIdColumnMeta().getColumnName());
   
  }
View Full Code Here

  }

  @Override
  public DboColumnMeta getFkMetaIfExist(DboTableMeta tableMeta, String column) {
    DboTableMeta fkToTable = createTableMeta("fktable"+System.currentTimeMillis());
    DboColumnToOneMeta toOne = new DboColumnToOneMeta();
    toOne.setup(tableMeta, column, fkToTable, true, false);
    return toOne;
  }
View Full Code Here

    DboColumnMeta columnMeta = facade.getFkMetaIfExist(tableMeta, column);
    if(!(columnMeta instanceof DboColumnToOneMeta))
      throw new IllegalArgumentException("Column="+column+" on table="+tableMeta.getColumnFamily()+" is NOT a OneToOne NOR ManyToOne relationship according to our meta data");
    else if(!columnMeta.isIndexed())
      throw new IllegalArgumentException("Column="+column+" on table="+tableMeta.getColumnFamily()+" is not indexed.  Add @NoSqlIndex or map/reduce a new index in place and add annotation");
    DboColumnToOneMeta toOne = (DboColumnToOneMeta) columnMeta;
    DboTableMeta fkTableMeta = toOne.getFkToColumnFamily();

    ViewInfoImpl existing = wiring.getInfoFromAlias(newAlias);
    if(existing == null) {
      existing = new ViewInfoImpl(newAlias, fkTableMeta);
      wiring.putAliasTable(newAlias, existing);
View Full Code Here

    }
    else {
      Object value = column.getValue();
      DboColumnMeta colMeta = data.getColumnMeta();
      if (value == null && colMeta instanceof DboColumnToOneMeta) {
        DboColumnToOneMeta one = (DboColumnToOneMeta) colMeta;
        value = one.convertFromStorage2(column.getCompositeSubName());
      }
      if(!valuesEqual(pt.getIndexedValue(), value)) {
        System.out.println("Entity with rowkey="+pt.getKeyAsString()+" has extra incorrect index point with value="+pt.getIndexedValueAsString()+" correct value should be= "+value);
        s.removeIndexPoint(pt, data.getPartitionBy(), data.getPartitionId());
        IndexColumn col = new IndexColumn();
View Full Code Here

    DboColumnMeta columnMeta = facade.getFkMetaIfExist(tableMeta, column);
    if(!(columnMeta instanceof DboColumnToOneMeta))
      throw new IllegalArgumentException("Column="+column+" on table="+tableMeta.getColumnFamily()+" is NOT a OneToOne NOR ManyToOne relationship according to our meta data");
    else if(!columnMeta.isIndexed())
      throw new IllegalArgumentException("Column="+column+" on table="+tableMeta.getColumnFamily()+" is not indexed.  Add @NoSqlIndex or map/reduce a new index in place and add annotation");
    DboColumnToOneMeta toOne = (DboColumnToOneMeta) columnMeta;
    DboTableMeta fkTableMeta = toOne.getFkToColumnFamily();

    ViewInfoImpl existing = wiring.getInfoFromAlias(newAlias);
    if(existing == null) {
      existing = new ViewInfoImpl(newAlias, fkTableMeta);
      wiring.putAliasTable(newAlias, existing);
View Full Code Here

    DboColumnMeta columnMeta = facade.getFkMetaIfExist(tableMeta, column);
    if(!(columnMeta instanceof DboColumnToOneMeta))
      throw new IllegalArgumentException("Column="+column+" on table="+tableMeta.getColumnFamily()+" is NOT a OneToOne NOR ManyToOne relationship according to our meta data");
    else if(!columnMeta.isIndexed())
      throw new IllegalArgumentException("Column="+column+" on table="+tableMeta.getColumnFamily()+" is not indexed.  Add @NoSqlIndex or map/reduce a new index in place and add annotation");
    DboColumnToOneMeta toOne = (DboColumnToOneMeta) columnMeta;
    DboTableMeta fkTableMeta = toOne.getFkToColumnFamily();

    ViewInfoImpl existing = wiring.getInfoFromAlias(newAlias);
    if(existing == null) {
      existing = new ViewInfoImpl(newAlias, fkTableMeta);
      wiring.putAliasTable(newAlias, existing);
View Full Code Here

    DboColumnMeta columnMeta = facade.getFkMetaIfExist(tableMeta, column);
    if(!(columnMeta instanceof DboColumnToOneMeta))
      throw new IllegalArgumentException("Column="+column+" on table="+tableMeta.getColumnFamily()+" is NOT a OneToOne NOR ManyToOne relationship according to our meta data");
    else if(!columnMeta.isIndexed())
      throw new IllegalArgumentException("Column="+column+" on table="+tableMeta.getColumnFamily()+" is not indexed.  Add @NoSqlIndex or map/reduce a new index in place and add annotation");
    DboColumnToOneMeta toOne = (DboColumnToOneMeta) columnMeta;
    DboTableMeta fkTableMeta = toOne.getFkToColumnFamily();

    ViewInfoImpl existing = wiring.getInfoFromAlias(newAlias);
    if(existing == null) {
      existing = new ViewInfoImpl(newAlias, fkTableMeta);
      wiring.putAliasTable(newAlias, existing);
View Full Code Here

  private void listByPartition(DboColumnMeta colMeta, NoSqlEntityManager mgr) {
    if(!(colMeta instanceof DboColumnToOneMeta))
      throw new InvalidCommand("We can only list the partitions when partitioning by a field with @ManyToOne annotation and col="+colMeta.getColumnName()+" does not have that annotation");
    String cf = colMeta.getOwner().getColumnFamily();
   
    DboColumnToOneMeta fkMeta = (DboColumnToOneMeta) colMeta;
    DboTableMeta fkTable = fkMeta.getFkToColumnFamily();
   
    String sql = "SELECT * FROM "+fkTable.getColumnFamily();
    NoSqlTypedSession s = mgr.getTypedSession();
    QueryResult query = s.createQueryCursor(sql, 100);
    ViewInfo oneView = query.getViews().get(0);
   
    Cursor<IndexColumnInfo> cursor = query.getCursor();

    String firstPart = "/"+cf+"/<AnyIndexedColumn>/"+fkMeta.getColumnName()+"/";

    System.out.println("Printing partitions of "+cf+" by column "+colMeta.getColumnName());
    System.out.println("");
    //always print the nullpartition first and start count at with 1...
    System.out.println("/"+cf+"/<AnyIndexedColumn>");
View Full Code Here

TOP

Related Classes of com.alvazan.orm.api.z8spi.meta.DboColumnToOneMeta

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.