package org.datanucleus.samples.multitenancy;

import javax.persistence.Entity;
import javax.persistence.Id;

import org.datanucleus.api.jpa.annotations.MultiTenant;

@Entity
@MultiTenant(columnLength = 40)
public class TenantedObject
{
    @Id
    long id;
    
    String name;

    public void setId(long id)
    {
        this.id = id;
    }
    public long getId()
    {
        return this.id;
    }

    public void setName(String name)
    {
        this.name = name;
    }
    public String getName()
    {
        return this.name;
    }
}

@@ -1,8 +1,766 @@
+/**********************************************************************%0ACopyright (c) 2021 Andy Jefferson and others. All rights reserved.%0ALicensed under the Apache License, Version 2.0 (the %22License%22);%0Ayou may not use this file except in compliance with the License.%0AYou may obtain a copy of the License at%0A%0A    http://www.apache.org/licenses/LICENSE-2.0%0A%0AUnless required by applicable law or agreed to in writing, software%0Adistributed under the License is distributed on an %22AS IS%22 BASIS,%0AWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0ASee the License for the specific language governing permissions and%0Alimitations under the License.%0A%0AContributors:%0A    ...%0A**********************************************************************/%0A
 package 
@@ -859,16 +859,80 @@
 ence.Id;
+%0Aimport javax.persistence.Index;%0Aimport javax.persistence.Table;
 %0A%0Aimport
@@ -995,20 +995,116 @@
 ty%0A@
-MultiTenant(
+Table(indexes = %7B@Index(name = %22TENANT_IDX%22, columnList = %22TENANT_ID%22)%7D)%0A@MultiTenant(column = %22TENANT_ID%22, 
 colu

Add index